// build-fail trait Unsigned { const MAX: u8; } struct U8(u8); impl Unsigned for U8 { const MAX: u8 = 0xff; } struct Sum(A,B); impl Unsigned for Sum { const MAX: u8 = A::MAX + B::MAX; //~^ ERROR any use of this value will cause an error [const_err] //~| WARN this was previously accepted by the compiler but is being phased out } fn foo(_: T) -> &'static u8 { &Sum::::MAX //~^ ERROR E0080 } fn main() { foo(0); }