]> git.lizzy.rs Git - rust.git/blob - tests/ui/unreachable-code.rs
Rollup merge of #107692 - Swatinem:printsizeyield, r=compiler-errors
[rust.git] / tests / ui / unreachable-code.rs
1 // run-pass
2
3 #![allow(unused_must_use)]
4 #![allow(dead_code)]
5
6 #![allow(path_statements)]
7 #![allow(unreachable_code)]
8 #![allow(unused_variables)]
9
10 fn id(x: bool) -> bool { x }
11
12 fn call_id() {
13     let c = panic!();
14     id(c);
15 }
16
17 fn call_id_2() { id(true) && id(return); }
18
19 fn call_id_3() { id(return) && id(return); }
20
21 fn ret_guard() {
22     match 2 {
23       x if (return) => { x; }
24       _ => {}
25     }
26 }
27
28 pub fn main() {}