@@ -5,45 +5,37 @@ LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
5
5
| ^^^^^^^^^^^^^^^^^^ assignment in pattern guard
6
6
7
7
error[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
9
9
|
10
10
LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
11
11
| ^ borrowed mutably in pattern guard
12
12
|
13
13
= help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
14
14
15
15
error[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
17
17
|
18
18
LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
19
19
| ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
20
20
21
- warning [E0510]: cannot assign `x` in match guard
21
+ error [E0510]: cannot assign `x` in match guard
22
22
--> $DIR/borrowck-mutate-in-guard.rs:10:25
23
23
|
24
24
LL | match x {
25
25
| - value is immutable in match guard
26
26
LL | Enum::A(_) if { x = Enum::B(false); false } => 1,
27
27
| ^^^^^^^^^^^^^^^^^^ 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`
32
28
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
35
31
|
36
32
LL | match x {
37
33
| - value is immutable in match guard
38
34
...
39
35
LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
40
36
| ^^^^^^ 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`
45
37
46
- error: aborting due to 3 previous errors
38
+ error: aborting due to 5 previous errors
47
39
48
40
Some errors have detailed explanations: E0301, E0302, E0510.
49
41
For more information about an error, try `rustc --explain E0301`.
0 commit comments