rust/tests/ui/nll/assign-while-to-immutable.rs
2023-01-11 09:32:08 +00:00

12 lines
233 B
Rust

// We used to incorrectly assign to `x` twice when generating MIR for this
// function, preventing this from compiling.
// check-pass
fn main() {
let x = while false {
break;
};
let y = 'l: while break 'l {};
}