mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
11 lines
189 B
Rust
11 lines
189 B
Rust
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);
|
|
}
|