rust/tests/source/break-and-continue.rs
Erick Tryzelaar e67ffcfb21 Update to the latest syntex module
One notable feature is this this adds support for the experimental
`let x = loop { ... break $expr; }` syntax. This also includes a
test for formatting all the break and continue variations.
2016-12-23 11:20:07 -08:00

23 lines
310 B
Rust

// break and continue formatting
#![feature(loop_break_value)]
fn main() {
'a: loop {
break 'a;
}
let mut done = false;
'b: while !done {
done = true;
continue 'b;
}
let x = loop {
break 5;
};
let x = 'c: loop {
break 'c 5;
};
}