summaryrefslogtreecommitdiffstats
path: root/src/test/ui/let-else/let-else-binding-immutable.rs
blob: ff2d9f240a094f70bef7933ace621b76e7092aec (plain)
1
2
3
4
5
6
7
8
9
10
// from rfc2005 test suite



pub fn main() {
    let Some(x) = &Some(3) else {
        panic!();
    };
    *x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference
}