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