2019-12-11 08:51:28 -06:00
|
|
|
#![feature(never_type)]
|
2017-03-21 08:41:41 -05:00
|
|
|
#![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:
|
2017-11-20 06:13:27 -06:00
|
|
|
Foo.foo(return, 22); //~ ERROR unreachable
|
2017-03-21 08:41:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn b() {
|
|
|
|
// the call is unreachable:
|
2017-11-20 06:13:27 -06:00
|
|
|
Foo.bar(return); //~ ERROR unreachable
|
2017-03-21 08:41:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|