summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs
blob: 97107c2e30f00e151f614e9ddd682f308db760b8 (plain)
1
2
3
4
5
6
7
8
9
10
fn main() {
    let mut _a = 3;
    let b = &mut _a;
    {
        let c = &*b;
        _a = 4; //~ ERROR cannot assign to `_a` because it is borrowed
        drop(c);
    }
    drop(b);
}