]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/issue-66693-panic-in-array-len.rs
1 // This is a separate test from `issue-66693.rs` because array lengths are evaluated
2 // in a separate stage before `const`s and `statics` and so the error below is hit and
3 // the compiler exits before generating errors for the others.
5 #![feature(const_panic)]
8 let _
= [0i32; panic
!(2f32)];
9 //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
11 // ensure that conforming panics are handled correctly
12 let _
= [false; panic
!()];
13 //~^ ERROR: evaluation of constant value failed
15 // typechecking halts before getting to this one
16 let _
= ['a'
, panic
!("panic in array len")];