rust/tests/ui/reachable/expr_call.rs
2023-01-11 09:32:08 +00: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() { }