1 #![feature(never_type)] 2 #![allow(unused_variables)] 3 #![deny(unreachable_code)] 4 5 use std::ops; 6 7 struct Foo; 8 9 impl ops::Add<!> for Foo { 10 type Output = !; add(self, rhs: !) -> !11 fn add(self, rhs: !) -> ! { 12 unimplemented!() 13 } 14 } 15 main()16fn main() { 17 let x = Foo + return; //~ ERROR unreachable 18 } 19