summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issue-27282-mutate-before-diverging-arm-2.stderr
blob: df5e4300ceca2904fb2c772be008a7f0f416b7ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
error[E0500]: closure requires unique access to `x` but it is already borrowed
  --> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:38:18
   |
LL |        match x {
   |   _____-
   |  |_____|
   | ||
LL | ||         &mut None => panic!("unreachable"),
LL | ||         &mut Some(&_)
LL | ||             if {
LL | ||                 // ForceFnOnce needed to exploit #27282
LL | ||                 (|| { *x = None; drop(force_fn_once); })();
   | ||                  ^^    - borrow occurs due to use of `x` in closure
   | ||                  |
   | ||                  closure construction occurs here
...  ||
LL | ||         _ => panic!("unreachable"),
LL | ||     }
   | ||     -
   | ||_____|
   | |______borrow occurs here
   |        borrow later used here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0500`.