diff options
Diffstat (limited to 'tests/ui/array-slice-vec/array_const_index-0.rs')
-rw-r--r-- | tests/ui/array-slice-vec/array_const_index-0.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/array-slice-vec/array_const_index-0.rs b/tests/ui/array-slice-vec/array_const_index-0.rs new file mode 100644 index 000000000..96755802e --- /dev/null +++ b/tests/ui/array-slice-vec/array_const_index-0.rs @@ -0,0 +1,8 @@ +const A: &'static [i32] = &[]; +const B: i32 = (&A)[1]; +//~^ index out of bounds: the length is 0 but the index is 1 +//~| ERROR evaluation of constant value failed + +fn main() { + let _ = B; +} |