1 //! Make sure we error on erroneous consts even if they are unused.
2 #![warn(const_err, unconditional_panic)]
4 struct PrintName<T>(T);
6 const VOID: () = [()][2]; //~WARN any use of this value will cause an error
7 //~^ WARN this operation will panic at runtime
10 const fn no_codegen<T>() {
12 let _ = PrintName::<T>::VOID; //~ERROR could not evaluate static initializer
16 pub static FOO: () = no_codegen::<i32>();