summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/unused-braces-while-let-with-mutable-value.rs
blob: ac547293c583a4bc67d6865deb6f9e5c6fbc6e4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// check-pass

#![deny(unused_braces)]

fn main() {
    let mut a = Some(3);
    // Shouldn't warn below `a`.
    while let Some(ref mut v) = {a} {
        a.as_mut().map(|a| std::mem::swap(a, v));
        break;
    }
}