@@ -5,45 +5,37 @@ LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
55 | ^^^^^^^^^^^^^^^^^^ assignment in pattern guard
66
77error[E0301]: cannot mutably borrow in a pattern guard
8- --> $DIR/borrowck-mutate-in-guard.rs:15 :38
8+ --> $DIR/borrowck-mutate-in-guard.rs:13 :38
99 |
1010LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
1111 | ^ borrowed mutably in pattern guard
1212 |
1313 = help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
1414
1515error[E0302]: cannot assign in a pattern guard
16- --> $DIR/borrowck-mutate-in-guard.rs:15 :41
16+ --> $DIR/borrowck-mutate-in-guard.rs:13 :41
1717 |
1818LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
1919 | ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
2020
21- warning [E0510]: cannot assign `x` in match guard
21+ error [E0510]: cannot assign `x` in match guard
2222 --> $DIR/borrowck-mutate-in-guard.rs:10:25
2323 |
2424LL | match x {
2525 | - value is immutable in match guard
2626LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
2727 | ^^^^^^^^^^^^^^^^^^ cannot assign
28- |
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`
3228
33- warning [E0510]: cannot mutably borrow `x` in match guard
34- --> $DIR/borrowck-mutate-in-guard.rs:15 :33
29+ error [E0510]: cannot mutably borrow `x` in match guard
30+ --> $DIR/borrowck-mutate-in-guard.rs:13 :33
3531 |
3632LL | match x {
3733 | - value is immutable in match guard
3834...
3935LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
4036 | ^^^^^^ cannot mutably borrow
41- |
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`
4537
46- error: aborting due to 3 previous errors
38+ error: aborting due to 5 previous errors
4739
4840Some errors have detailed explanations: E0301, E0302, E0510.
4941For more information about an error, try `rustc --explain E0301`.
0 commit comments