|
1 | 1 | error[E0510]: cannot assign `x` in match guard
|
2 |
| - --> $DIR/borrowck-mutate-in-guard.rs:10:25 |
| 2 | + --> $DIR/borrowck-mutate-in-guard.rs:12:25 |
3 | 3 | |
|
4 | 4 | LL | match x {
|
5 | 5 | | - value is immutable in match guard
|
6 | 6 | LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
|
7 | 7 | | ^^^^^^^^^^^^^^^^^^ cannot assign
|
8 | 8 |
|
9 | 9 | error[E0510]: cannot mutably borrow `x` in match guard
|
10 |
| - --> $DIR/borrowck-mutate-in-guard.rs:12:33 |
| 10 | + --> $DIR/borrowck-mutate-in-guard.rs:14:33 |
11 | 11 | |
|
12 | 12 | LL | match x {
|
13 | 13 | | - value is immutable in match guard
|
14 | 14 | ...
|
15 | 15 | LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
|
16 | 16 | | ^^^^^^ cannot mutably borrow
|
17 | 17 |
|
18 |
| -error: aborting due to 2 previous errors |
| 18 | +error[E0510]: cannot assign `x` in match guard |
| 19 | + --> $DIR/borrowck-mutate-in-guard.rs:25:40 |
| 20 | + | |
| 21 | +LL | match x { |
| 22 | + | - value is immutable in match guard |
| 23 | +LL | Enum::A(_) if let Some(()) = { x = Enum::B(false); None } => 1, |
| 24 | + | ^^^^^^^^^^^^^^^^^^ cannot assign |
| 25 | + |
| 26 | +error[E0510]: cannot mutably borrow `x` in match guard |
| 27 | + --> $DIR/borrowck-mutate-in-guard.rs:27:48 |
| 28 | + | |
| 29 | +LL | match x { |
| 30 | + | - value is immutable in match guard |
| 31 | +... |
| 32 | +LL | Enum::A(_) if let Some(()) = { let y = &mut x; *y = Enum::B(false); None } => 1, |
| 33 | + | ^^^^^^ cannot mutably borrow |
| 34 | + |
| 35 | +error: aborting due to 4 previous errors |
19 | 36 |
|
20 | 37 | For more information about this error, try `rustc --explain E0510`.
|
0 commit comments