rust/tests/ui/reachable/expr_method.rs
2023-01-11 09:32:08 +00:00

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() { }