]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/issue-66693.rs
1 // Tests that the compiler does not ICE when const-evaluating a `panic!()` invocation with a
2 // non-`&str` argument.
4 const _
: () = panic
!(1);
5 //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
7 static _FOO
: () = panic
!(true);
8 //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
11 panic
!(&1); //~ ERROR: argument to `panic!()` in a const context must have type `&str`
14 // ensure that conforming panics don't cause an error
15 const _
: () = panic
!();
16 static _BAR
: () = panic
!("panic in static");
19 panic
!("panic in const fn");