rust/src/test/ui/reachable/expr_add.rs
2019-12-14 09:01:04 -05:00

18 lines
284 B
Rust

#![feature(never_type)]
#![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() {
let x = Foo + return; //~ ERROR unreachable
}