summaryrefslogtreecommitdiffstats
path: root/src/test/ui/let-else/let-else-binding-explicit-mut-pass.rs
blob: b0a6264a10d45ac02a92da2794b498e9a467ae54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// check-pass



fn main() {
    let Some(n) = &mut &mut Some(5i32) else { return; };
    *n += 1; // OK
    let _ = n;

    let Some(n): &mut Option<i32> = &mut &mut Some(5i32) else { return; };
    *n += 1; // OK
    let _ = n;
}