1 // Tests that the compiler does not ICE when const-evaluating a `panic!()` invocation with a
2 // non-`&str` argument.
4 #![feature(const_panic)]
6 const _: () = panic!(1);
7 //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
9 static _FOO: () = panic!(true);
10 //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
13 panic!(&1); //~ ERROR: argument to `panic!()` in a const context must have type `&str`
16 // ensure that conforming panics don't cause an error
17 const _: () = panic!();
18 static _BAR: () = panic!("panic in static");
21 panic!("panic in const fn");