2018-05-23 04:21:01 -05:00
|
|
|
error[E0500]: closure requires unique access to `x` but it is already borrowed
|
|
|
|
--> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:33:14
|
|
|
|
|
|
2018-07-22 15:13:18 -05:00
|
|
|
LL | match x {
|
|
|
|
| - borrow occurs here
|
|
|
|
...
|
|
|
|
LL | (|| { *x = None; drop(force_fn_once); })();
|
2018-08-01 15:02:10 -05:00
|
|
|
| ^^ - second borrow occurs due to use of `x` in closure
|
2018-07-22 15:13:18 -05:00
|
|
|
| |
|
|
|
|
| closure construction occurs here
|
|
|
|
...
|
|
|
|
LL | &mut Some(&a) if { // this binds to garbage if we've corrupted discriminant
|
|
|
|
| ------------- borrow later used here
|
2018-05-23 04:21:01 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0500`.
|