]> git.lizzy.rs Git - rust.git/blob - src/test/ui/reachable/expr_add.rs
Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelid
[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 }