2018-08-08 14:28:26 +02:00
|
|
|
error[E0302]: cannot assign in a pattern guard
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:10:25
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ assignment in pattern guard
|
|
|
|
|
|
|
|
error[E0301]: cannot mutably borrow in a pattern guard
|
2019-07-28 03:30:28 +02:00
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:13:38
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
|
|
|
|
| ^ borrowed mutably in pattern guard
|
2019-04-22 08:40:08 +01:00
|
|
|
|
|
2019-07-06 09:48:03 +02:00
|
|
|
= help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error[E0302]: cannot assign in a pattern guard
|
2019-07-28 03:30:28 +02:00
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:13:41
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
|
|
|
|
|
2019-07-28 03:30:28 +02:00
|
|
|
error[E0510]: cannot assign `x` in match guard
|
2019-04-15 12:54:18 -07:00
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:10:25
|
|
|
|
|
|
|
|
|
LL | match x {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ cannot assign
|
|
|
|
|
2019-07-28 03:30:28 +02:00
|
|
|
error[E0510]: cannot mutably borrow `x` in match guard
|
|
|
|
--> $DIR/borrowck-mutate-in-guard.rs:13:33
|
2019-04-15 12:54:18 -07: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
|
|
|
|
|
2019-07-28 03:30:28 +02:00
|
|
|
error: aborting due to 5 previous errors
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2019-04-15 12:54:18 -07:00
|
|
|
Some errors have detailed explanations: E0301, E0302, E0510.
|
2018-08-08 14:28:26 +02:00
|
|
|
For more information about an error, try `rustc --explain E0301`.
|