]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr
Rollup merge of #53545 - FelixMcFelix:fix-50865-beta, r=petrochenkov
[rust.git] / src / test / ui / issues / issue-27282-mutate-before-diverging-arm-1.stderr
1 error[E0500]: closure requires unique access to `x` but it is already borrowed
2   --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:33:14
3    |
4 LL |     match x {
5    |           - borrow occurs here
6 ...
7 LL |             (|| { *x = None; drop(force_fn_once); })();
8    |              ^^    - second borrow occurs due to use of `x` in closure
9    |              |
10    |              closure construction occurs here
11 ...
12 LL |         &mut Some(&a) if { // this binds to garbage if we've corrupted discriminant
13    |         ------------- borrow later used here
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0500`.