2019-07-16 00:30:23 -05:00
|
|
|
error: range is out of bounds
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/out_of_bounds_indexing/simple.rs:7:11
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
|
LL | &x[..=4];
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::out_of_bounds_indexing)]`
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
error: range is out of bounds
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/out_of_bounds_indexing/simple.rs:10:11
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
|
LL | &x[1..5];
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/out_of_bounds_indexing/simple.rs:12:8
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
|
LL | &x[5..];
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/out_of_bounds_indexing/simple.rs:14:10
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
|
LL | &x[..5];
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/out_of_bounds_indexing/simple.rs:16:8
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
|
LL | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/out_of_bounds_indexing/simple.rs:18:12
|
2019-07-16 00:30:23 -05:00
|
|
|
|
|
|
|
|
LL | &x[0..=4];
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|