2016-04-21 08:15:56 -05:00
|
|
|
const A: &'static [i32] = &[];
|
|
|
|
const B: i32 = (&A)[1];
|
2020-09-15 14:34:50 -05:00
|
|
|
//~^ index out of bounds: the length is 0 but the index is 1
|
2022-09-21 06:05:20 -05:00
|
|
|
//~| ERROR evaluation of constant value failed
|
2015-11-18 03:57:52 -06:00
|
|
|
|
|
|
|
fn main() {
|
2018-09-19 10:22:03 -05:00
|
|
|
let _ = B;
|
2015-11-18 03:57:52 -06:00
|
|
|
}
|