//! Make sure we detect erroneous constants post-monomorphization even when they are unused. //! (https://github.com/rust-lang/miri/issues/1382) // Inlining changes the error location //@compile-flags: -Zmir-opt-level=0 #![feature(never_type)] #![warn(warnings, const_err)] struct PrintName(T); impl PrintName { const VOID: ! = panic!(); //~ERROR: evaluation of `PrintName::::VOID` failed } fn no_codegen() { if false { let _ = PrintName::::VOID; //~ERROR: post-monomorphization error } } fn main() { no_codegen::(); }