summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/assign-while-to-immutable.rs
blob: 24eaa8a23883d3e8fb18636030d798bd6bb433c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
// 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 {};
}