summaryrefslogtreecommitdiffstats
path: root/src/test/ui/reachable/expr_add.rs
blob: b45e5daf42c8d6498ca21b700b21ccabfd5f1765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![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
}