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`
12 //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
13 //~| ERROR: erroneous constant used [const_err]
14 //~| WARNING: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
17 // ensure that conforming panics don't cause an error
18 const _: () = panic!();
19 static _BAR: () = panic!("panic in static");
22 panic!("panic in const fn");