rust/tests/ui/unreachable-code.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
418 B
Rust
Raw Normal View History

// run-pass
#![allow(unused_must_use)]
#![allow(dead_code)]
#![allow(path_statements)]
#![allow(unreachable_code)]
#![allow(unused_variables)]
fn id(x: bool) -> bool { x }
fn call_id() {
let c = panic!();
id(c);
}
2012-08-02 00:30:05 +00:00
fn call_id_2() { id(true) && id(return); }
2012-08-02 00:30:05 +00:00
fn call_id_3() { id(return) && id(return); }
fn ret_guard() {
2015-01-25 21:05:03 +00:00
match 2 {
2012-08-04 02:59:04 +00:00
x if (return) => { x; }
_ => {}
}
}
pub fn main() {}