mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 06:35:27 +00:00
update_references indexing_slicing
This commit is contained in:
parent
5285372f68
commit
105ae712f4
@ -1,3 +1,29 @@
|
||||
error: index out of bounds: the len is 4 but the index is 4
|
||||
--> $DIR/indexing_slicing.rs:28:5
|
||||
|
|
||||
28 | 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:29:5
|
||||
|
|
||||
29 | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: index out of bounds: the len is 0 but the index is 0
|
||||
--> $DIR/indexing_slicing.rs:59:5
|
||||
|
|
||||
59 | empty[0]; // 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:90:5
|
||||
|
|
||||
90 | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
|
||||
| ^^^^
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:23:5
|
||||
|
|
||||
@ -279,5 +305,5 @@ error: range is out of bounds
|
||||
98 | &x[10..num]; // should trigger out of bounds error
|
||||
| ^^
|
||||
|
||||
error: aborting due to 39 previous errors
|
||||
error: aborting due to 43 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user