File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 1+ error: index out of bounds: the len is 4 but the index is 4
2+ --> $DIR/indexing_slicing.rs:28:5
3+ |
4+ 28 | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
5+ | ^^^^
6+ |
7+ = note: #[deny(const_err)] on by default
8+
9+ error: index out of bounds: the len is 4 but the index is 8
10+ --> $DIR/indexing_slicing.rs:29:5
11+ |
12+ 29 | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
13+ | ^^^^^^^^^
14+
15+ error: index out of bounds: the len is 0 but the index is 0
16+ --> $DIR/indexing_slicing.rs:59:5
17+ |
18+ 59 | empty[0]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
19+ | ^^^^^^^^
20+
21+ error: index out of bounds: the len is 4 but the index is 15
22+ --> $DIR/indexing_slicing.rs:90:5
23+ |
24+ 90 | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
25+ | ^^^^
26+
127error: indexing may panic.
228 --> $DIR/indexing_slicing.rs:23:5
329 |
@@ -279,5 +305,5 @@ error: range is out of bounds
27930598 | &x[10..num]; // should trigger out of bounds error
280306 | ^^
281307
282- error: aborting due to 39 previous errors
308+ error: aborting due to 43 previous errors
283309
You can’t perform that action at this time.
0 commit comments