rust/tests/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
189 B
Rust
Raw Normal View History

fn main() {
2015-01-31 16:23:42 +00:00
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);
}