mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
This commit is contained in:
parent
abdb277a85
commit
907078a8f8
1 changed files with 21 additions and 1 deletions
|
@ -1,3 +1,23 @@
|
||||||
|
error: index out of bounds: the len is 4 but the index is 4
|
||||||
|
--> $DIR/indexing_slicing.rs:18:5
|
||||||
|
|
|
||||||
|
LL | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
|
||||||
|
| ^^^^
|
||||||
|
|
|
||||||
|
= note: `#[deny(const_err)]` on by default
|
||||||
|
|
||||||
|
error: index out of bounds: the len is 4 but the index is 8
|
||||||
|
--> $DIR/indexing_slicing.rs:19:5
|
||||||
|
|
|
||||||
|
LL | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
|
||||||
|
| ^^^^^^^^^
|
||||||
|
|
||||||
|
error: index out of bounds: the len is 4 but the index is 15
|
||||||
|
--> $DIR/indexing_slicing.rs:54:5
|
||||||
|
|
|
||||||
|
LL | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
|
||||||
|
| ^^^^
|
||||||
|
|
||||||
error: indexing may panic.
|
error: indexing may panic.
|
||||||
--> $DIR/indexing_slicing.rs:13:5
|
--> $DIR/indexing_slicing.rs:13:5
|
||||||
|
|
|
|
||||||
|
@ -189,5 +209,5 @@ LL | v[M];
|
||||||
|
|
|
|
||||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||||
|
|
||||||
error: aborting due to 24 previous errors
|
error: aborting due to 27 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue