2016-04-21 16:15:56 +03:00
|
|
|
const A: &'static [i32] = &[];
|
|
|
|
|
const B: i32 = (&A)[1];
|
2020-09-15 20:34:50 +01:00
|
|
|
//~^ index out of bounds: the length is 0 but the index is 1
|
2018-08-26 15:19:34 +02:00
|
|
|
//~| ERROR any use of this value will cause an error
|
2015-11-18 10:57:52 +01:00
|
|
|
|
|
|
|
|
fn main() {
|
2018-09-19 17:22:03 +02:00
|
|
|
let _ = B;
|
2015-11-18 10:57:52 +01:00
|
|
|
}
|