1 error[E0302]: cannot assign in a pattern guard
2 --> $DIR/borrowck-mutate-in-guard.rs:10:25
4 LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
5 | ^^^^^^^^^^^^^^^^^^ assignment in pattern guard
7 error[E0301]: cannot mutably borrow in a pattern guard
8 --> $DIR/borrowck-mutate-in-guard.rs:15:38
10 LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
11 | ^ borrowed mutably in pattern guard
13 = help: add #![feature(bind_by_move_pattern_guards)] to the crate attributes to enable
15 error[E0302]: cannot assign in a pattern guard
16 --> $DIR/borrowck-mutate-in-guard.rs:15:41
18 LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
19 | ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
21 warning[E0510]: cannot assign `x` in match guard
22 --> $DIR/borrowck-mutate-in-guard.rs:10:25
25 | - value is immutable in match guard
26 LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
27 | ^^^^^^^^^^^^^^^^^^ cannot assign
29 = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
30 = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
31 = note: for more information, try `rustc --explain E0729`
33 warning[E0510]: cannot mutably borrow `x` in match guard
34 --> $DIR/borrowck-mutate-in-guard.rs:15:33
37 | - value is immutable in match guard
39 LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
40 | ^^^^^^ cannot mutably borrow
42 = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
43 = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
44 = note: for more information, try `rustc --explain E0729`
46 error: aborting due to 3 previous errors
48 Some errors have detailed explanations: E0301, E0302, E0510.
49 For more information about an error, try `rustc --explain E0301`.