File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1010
1111static FOO : i32 = [ ] [ 0 ] ;
1212//~^ ERROR E0080
13+ //~| ERROR E0080
1314
1415fn main ( ) {
1516 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
22 --> $DIR/index_out_of_bounds.rs:11:19
33 |
44LL | static FOO: i32 = [][0];
55 | ^^^^^ index out of bounds: the len is 0 but the index is 0
66
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+
715error: 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
917 |
1018LL | array[1]; //~ ERROR index out of bounds
1119 | ^^^^^^^^
1220 |
1321 = note: #[deny(const_err)] on by default
1422
15- error: aborting due to 2 previous errors
23+ error: aborting due to 3 previous errors
1624
1725For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments