2016-04-21 08:15:56 -05:00
|
|
|
const A: &'static [i32] = &[];
|
|
|
|
const B: i32 = (&A)[1];
|
2018-05-11 07:33:37 -05:00
|
|
|
//~^ index out of bounds: the len is 0 but the index is 1
|
2018-08-26 08:19:34 -05:00
|
|
|
//~| ERROR any use of this value will cause an error
|
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
|
|
|
}
|