mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
25 lines
416 B
Rust
25 lines
416 B
Rust
#![feature(never_type)]
|
|
#![allow(unused_variables)]
|
|
#![allow(unused_assignments)]
|
|
#![allow(dead_code)]
|
|
#![deny(unreachable_code)]
|
|
|
|
struct Foo;
|
|
|
|
impl Foo {
|
|
fn foo(&self, x: !, y: usize) { }
|
|
fn bar(&self, x: !) { }
|
|
}
|
|
|
|
fn a() {
|
|
// the `22` is unreachable:
|
|
Foo.foo(return, 22); //~ ERROR unreachable
|
|
}
|
|
|
|
fn b() {
|
|
// the call is unreachable:
|
|
Foo.bar(return); //~ ERROR unreachable
|
|
}
|
|
|
|
fn main() { }
|