rust/src/test/ui/reachable/expr_call.rs
2018-12-25 21:08:33 -07:00

22 lines
361 B
Rust

#![feature(never_type)]
#![allow(unused_variables)]
#![allow(unused_assignments)]
#![allow(dead_code)]
#![deny(unreachable_code)]
fn foo(x: !, y: usize) { }
fn bar(x: !) { }
fn a() {
// the `22` is unreachable:
foo(return, 22); //~ ERROR unreachable
}
fn b() {
// the call is unreachable:
bar(return); //~ ERROR unreachable
}
fn main() { }