]> git.proxmox.com Git - rustc.git/blame - tests/ui/unreachable-code.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / unreachable-code.rs
CommitLineData
416331ca
XL
1// run-pass
2
0bf4aa26
XL
3#![allow(unused_must_use)]
4#![allow(dead_code)]
5bcae85e 5#![allow(path_statements)]
1a4d82fc 6#![allow(unreachable_code)]
5bcae85e 7#![allow(unused_variables)]
781aab86 8#![feature(if_let_guard)]
223e47cc 9
781aab86
FG
10fn id(x: bool) -> bool {
11 x
12}
223e47cc
LB
13
14fn call_id() {
1a4d82fc 15 let c = panic!();
223e47cc
LB
16 id(c);
17}
18
781aab86
FG
19fn call_id_2() {
20 id(true) && id(return);
21}
223e47cc 22
781aab86
FG
23fn call_id_3() {
24 id(return) && id(return);
25}
223e47cc 26
223e47cc 27fn ret_guard() {
85aaf69f 28 match 2 {
223e47cc 29 x if (return) => { x; }
781aab86 30 x if let true = return => { x; }
223e47cc
LB
31 _ => {}
32 }
33}
34
35pub fn main() {}