mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 14:40:32 +00:00
23 lines
823 B
Text
23 lines
823 B
Text
error: this range is reversed and using it to index a slice will panic at run-time
|
|
--> tests/ui/reversed_empty_ranges_unfixable.rs:8:18
|
|
|
|
|
LL | let _ = &arr[3usize..=1usize];
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::reversed-empty-ranges` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::reversed_empty_ranges)]`
|
|
|
|
error: this range is reversed and using it to index a slice will panic at run-time
|
|
--> tests/ui/reversed_empty_ranges_unfixable.rs:11:18
|
|
|
|
|
LL | let _ = &arr[SOME_NUM..1];
|
|
| ^^^^^^^^^^^
|
|
|
|
error: this range is empty so it will yield no values
|
|
--> tests/ui/reversed_empty_ranges_unfixable.rs:14:14
|
|
|
|
|
LL | for _ in ANSWER..ANSWER {}
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|