]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
Auto merge of #60132 - davidtwco:issue-60075, r=estebank
[rust.git] / src / test / ui / borrowck / borrowck-mutate-in-guard.stderr
1 error[E0302]: cannot assign in a pattern guard
2   --> $DIR/borrowck-mutate-in-guard.rs:10:25
3    |
4 LL |         Enum::A(_) if { x = Enum::B(false); false } => 1,
5    |                         ^^^^^^^^^^^^^^^^^^ assignment in pattern guard
6
7 error[E0301]: cannot mutably borrow in a pattern guard
8   --> $DIR/borrowck-mutate-in-guard.rs:12:38
9    |
10 LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
11    |                                      ^ borrowed mutably in pattern guard
12
13 error[E0302]: cannot assign in a pattern guard
14   --> $DIR/borrowck-mutate-in-guard.rs:12:41
15    |
16 LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
17    |                                         ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
18
19 error: aborting due to 3 previous errors
20
21 Some errors have detailed explanations: E0301, E0302.
22 For more information about an error, try `rustc --explain E0301`.