2012-08-23 14:46:59 -07:00
|
|
|
fn main() {
|
2015-01-31 17:23:42 +01:00
|
|
|
let mut _a = 3;
|
2018-04-09 05:28:00 -04:00
|
|
|
let b = &mut _a;
|
2012-08-23 14:46:59 -07:00
|
|
|
{
|
2018-04-09 05:28:00 -04:00
|
|
|
let c = &*b;
|
2019-04-22 08:40:08 +01:00
|
|
|
_a = 4; //~ ERROR cannot assign to `_a` because it is borrowed
|
2018-04-09 05:28:00 -04:00
|
|
|
drop(c);
|
2012-08-23 14:46:59 -07:00
|
|
|
}
|
2018-04-09 05:28:00 -04:00
|
|
|
drop(b);
|
2012-08-23 14:46:59 -07:00
|
|
|
}
|