]> git.lizzy.rs Git - rust.git/blob - src/test/ui/reachable/expr_add.rs
Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into sync-rustfmt-subtree
[rust.git] / src / test / ui / reachable / expr_add.rs
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 = !;
11     fn add(self, rhs: !) -> ! {
12         unimplemented!()
13     }
14 }
15
16 fn main() {
17     let x = Foo + return; //~ ERROR unreachable
18 }