mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
22 lines
361 B
Rust
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() { }
|