mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
19 lines
284 B
Rust
19 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
|
|
}
|