diff options
Diffstat (limited to 'src/test/ui/consts/array-literal-index-oob.rs')
-rw-r--r-- | src/test/ui/consts/array-literal-index-oob.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/consts/array-literal-index-oob.rs b/src/test/ui/consts/array-literal-index-oob.rs new file mode 100644 index 000000000..9b3f735b1 --- /dev/null +++ b/src/test/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(const_err, unconditional_panic)] + +fn main() { + &{ [1, 2, 3][4] }; + //~^ WARN operation will panic +} |