]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
Sync portable-simd to rust-lang/portable-simd@72df4c45056a8bc0d1b3f06fdc828722177f0763
[rust.git] / src / test / ui / borrowck / borrowck-mutate-in-guard.stderr
1 error[E0510]: cannot assign `x` in match guard
2   --> $DIR/borrowck-mutate-in-guard.rs:10:25
3    |
4 LL |     match x {
5    |           - value is immutable in match guard
6 LL |         Enum::A(_) if { x = Enum::B(false); false } => 1,
7    |                         ^^^^^^^^^^^^^^^^^^ cannot assign
8
9 error[E0510]: cannot mutably borrow `x` in match guard
10   --> $DIR/borrowck-mutate-in-guard.rs:12:33
11    |
12 LL |     match x {
13    |           - value is immutable in match guard
14 ...
15 LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
16    |                                 ^^^^^^ cannot mutably borrow
17
18 error: aborting due to 2 previous errors
19
20 For more information about this error, try `rustc --explain E0510`.