File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 10
10
11
11
static FOO : i32 = [ ] [ 0 ] ;
12
12
//~^ ERROR E0080
13
+ //~| ERROR E0080
13
14
14
15
fn main ( ) {
15
16
let array = [ std:: env:: args ( ) . len ( ) ] ;
Original file line number Diff line number Diff line change 1
- error[E0080]: constant evaluation error
1
+ error[E0080]: could not evaluate static initializer
2
2
--> $DIR/index_out_of_bounds.rs:11:19
3
3
|
4
4
LL | static FOO: i32 = [][0];
5
5
| ^^^^^ index out of bounds: the len is 0 but the index is 0
6
6
7
+ error[E0080]: could not evaluate static initializer
8
+ --> $DIR/index_out_of_bounds.rs:11:1
9
+ |
10
+ LL | static FOO: i32 = [][0];
11
+ | ^^^^^^^^^^^^^^^^^^-----^
12
+ | |
13
+ | index out of bounds: the len is 0 but the index is 0
14
+
7
15
error: index out of bounds: the len is 1 but the index is 1
8
- --> $DIR/index_out_of_bounds.rs:16 :5
16
+ --> $DIR/index_out_of_bounds.rs:17 :5
9
17
|
10
18
LL | array[1]; //~ ERROR index out of bounds
11
19
| ^^^^^^^^
12
20
|
13
21
= note: #[deny(const_err)] on by default
14
22
15
- error: aborting due to 2 previous errors
23
+ error: aborting due to 3 previous errors
16
24
17
25
For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments