2019-12-11 08:51:28 -06:00
|
|
|
#![feature(never_type)]
|
2017-03-21 08:41:41 -05:00
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![deny(unreachable_code)]
|
|
|
|
|
|
|
|
use std::ops;
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl ops::Add<!> for Foo {
|
|
|
|
type Output = !;
|
|
|
|
fn add(self, rhs: !) -> ! {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2017-11-20 06:13:27 -06:00
|
|
|
let x = Foo + return; //~ ERROR unreachable
|
2017-03-21 08:41:41 -05:00
|
|
|
}
|