summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
blob: 6d05e97252d928df4fdb633518281dbc61331833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
error[E0510]: cannot assign `x` in match guard
  --> $DIR/borrowck-mutate-in-guard.rs:10:25
   |
LL |     match x {
   |           - value is immutable in match guard
LL |         Enum::A(_) if { x = Enum::B(false); false } => 1,
   |                         ^^^^^^^^^^^^^^^^^^ cannot assign

error[E0510]: cannot mutably borrow `x` in match guard
  --> $DIR/borrowck-mutate-in-guard.rs:12:33
   |
LL |     match x {
   |           - value is immutable in match guard
...
LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
   |                                 ^^^^^^ cannot mutably borrow

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0510`.