]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/reversed_empty_ranges_fixable.rs
Addition `manual_map` test for `unsafe` blocks
[rust.git] / tests / ui / reversed_empty_ranges_fixable.rs
index 6ed5ca6daa0e8fd537e8b7e0635234dbb6f491cb..b2e8bf33771acac68610d046227101c281dccaa5 100644 (file)
@@ -4,6 +4,8 @@
 const ANSWER: i32 = 42;
 
 fn main() {
+    // These should be linted:
+
     (42..=21).for_each(|x| println!("{}", x));
     let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
 
@@ -21,4 +23,7 @@ fn main() {
 
     for _ in 21..=42 {}
     for _ in 21..42 {}
+
+    // This range is empty but should be ignored, see issue #5689
+    let _ = &arr[0..0];
 }