update_references indexing_slicing

This commit is contained in:
Shotaro Yamada 2018-10-25 14:59:14 +09:00
parent 5285372f68
commit 105ae712f4
1 changed files with 27 additions and 1 deletions

View File

@ -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