2019-07-27 20:30:28 -05:00
|
|
|
error[E0510]: cannot assign `x` in match guard
|
2022-12-21 09:29:35 -06:00
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:12:25
|
2019-04-15 14:54:18 -05:00
|
|
|
|
|
|
|
|
LL | match x {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ cannot assign
|
|
|
|
|
2019-07-27 20:30:28 -05:00
|
|
|
error[E0510]: cannot mutably borrow `x` in match guard
|
2022-12-21 09:29:35 -06:00
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:14:33
|
2019-04-15 14:54:18 -05:00
|
|
|
|
|
|
|
|
LL | match x {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
...
|
|
|
|
LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
|
|
|
|
| ^^^^^^ cannot mutably borrow
|
|
|
|
|
2022-12-21 09:29:35 -06:00
|
|
|
error[E0510]: cannot assign `x` in match guard
|
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:25:40
|
|
|
|
|
|
|
|
|
LL | match x {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
LL | Enum::A(_) if let Some(()) = { x = Enum::B(false); None } => 1,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
error[E0510]: cannot mutably borrow `x` in match guard
|
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:27:48
|
|
|
|
|
|
|
|
|
LL | match x {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
...
|
|
|
|
LL | Enum::A(_) if let Some(()) = { let y = &mut x; *y = Enum::B(false); None } => 1,
|
|
|
|
| ^^^^^^ cannot mutably borrow
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2019-07-29 18:25:30 -05:00
|
|
|
For more information about this error, try `rustc --explain E0510`.
|