]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-mutate-in-guard.nll.stderr
Rollup merge of #54323 - Keruspe:rustc-color, r=Mark-Simulacrum
[rust.git] / src / test / ui / borrowck / borrowck-mutate-in-guard.nll.stderr
1 error[E0302]: cannot assign in a pattern guard
2   --> $DIR/borrowck-mutate-in-guard.rs:20: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:22: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    = help: add #![feature(bind_by_move_pattern_guards)] to the crate attributes to enable
14
15 error[E0302]: cannot assign in a pattern guard
16   --> $DIR/borrowck-mutate-in-guard.rs:22:41
17    |
18 LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
19    |                                         ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
20
21 error: aborting due to 3 previous errors
22
23 Some errors occurred: E0301, E0302.
24 For more information about an error, try `rustc --explain E0301`.