2017-03-21 08:41:41 -05:00
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![allow(unused_assignments)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![deny(unreachable_code)]
|
|
|
|
|
|
|
|
fn a() {
|
|
|
|
loop { return; }
|
|
|
|
println!("I am dead.");
|
2018-07-19 07:15:43 -05:00
|
|
|
//~^ ERROR unreachable statement
|
2017-03-21 08:41:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn b() {
|
|
|
|
loop {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
println!("I am not dead.");
|
|
|
|
}
|
|
|
|
|
|
|
|
fn c() {
|
|
|
|
loop { return; }
|
|
|
|
println!("I am dead.");
|
2018-07-19 07:15:43 -05:00
|
|
|
//~^ ERROR unreachable statement
|
2017-03-21 08:41:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn d() {
|
|
|
|
'outer: loop { loop { break 'outer; } }
|
|
|
|
println!("I am not dead.");
|
|
|
|
}
|
|
|
|
|
|
|
|
fn e() {
|
|
|
|
loop { 'middle: loop { loop { break 'middle; } } }
|
|
|
|
println!("I am dead.");
|
2018-07-19 07:15:43 -05:00
|
|
|
//~^ ERROR unreachable statement
|
2017-03-21 08:41:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|