diff options
Diffstat (limited to 'tests/ui/consts/array-literal-index-oob.rs')
-rw-r--r-- | tests/ui/consts/array-literal-index-oob.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/consts/array-literal-index-oob.rs b/tests/ui/consts/array-literal-index-oob.rs new file mode 100644 index 000000000..67b49b1ba --- /dev/null +++ b/tests/ui/consts/array-literal-index-oob.rs @@ -0,0 +1,9 @@ +// build-pass +// ignore-pass (test emits codegen-time warnings and verifies that they are not errors) + +#![warn(unconditional_panic)] + +fn main() { + &{ [1, 2, 3][4] }; + //~^ WARN operation will panic +} |