1 //! Make sure we detect erroneous constants post-monomorphization even when they are unused.
2 //! (https://github.com/rust-lang/miri/issues/1382)
3 // Inlining changes the error location
4 // compile-flags: -Zmir-opt-level=0
5 #![feature(const_panic)]
6 #![feature(never_type)]
7 #![warn(warnings, const_err)]
9 struct PrintName<T>(T);
10 impl<T> PrintName<T> {
11 const VOID: ! = panic!(); //~ERROR evaluation of `PrintName::<i32>::VOID` failed
16 let _ = PrintName::<T>::VOID; //~ERROR error occurred: encountered constant