Skip to content

Commit 105ae71

Browse files
committed
update_references indexing_slicing
1 parent 5285372 commit 105ae71

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/ui/indexing_slicing.stderr

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
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+
127
error: indexing may panic.
228
--> $DIR/indexing_slicing.rs:23:5
329
|
@@ -279,5 +305,5 @@ error: range is out of bounds
279305
98 | &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

0 commit comments

Comments
 (0)