// build-fail pub const unsafe fn fake_type() -> T { hint_unreachable() //~ ERROR evaluation of `::CONSTANT` failed } pub const unsafe fn hint_unreachable() -> ! { fake_type() } trait Const { const CONSTANT: i32 = unsafe { fake_type() }; } impl Const for T {} pub fn main() -> () { dbg!(i32::CONSTANT); //~ ERROR erroneous constant used }