]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/array-literal-index-oob.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / consts / array-literal-index-oob.rs
1 // build-pass
2 // ignore-pass (test emits codegen-time warnings and verifies that they are not errors)
3
4 #![warn(const_err, unconditional_panic)]
5
6 fn main() {
7 &{ [1, 2, 3][4] };
8 //~^ WARN operation will panic
9 //~| WARN reaching this expression at runtime will panic or abort
10 //~| WARN erroneous constant used [const_err]
11 }