summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-33819.rs
blob: fff5015cdc1c987bf1dd6625ec6dd093c10a6d40 (plain)
1
2
3
4
5
6
7
8
9
fn main() {
    let mut op = Some(2);
    match op {
        Some(ref v) => { let a = &mut v; },
        //~^ ERROR cannot borrow `v` as mutable, as it is not declared as mutable
        //~| HELP try removing `&mut` here
        None => {},
    }
}