summary refs log tree commit diff
path: root/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
blob: 7a111a1bbccc401b81141ffedaf67dbe301dd2b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
error[E0302]: cannot assign in a pattern guard
  --> $DIR/borrowck-mutate-in-guard.rs:20:25
   |
LL |         Enum::A(_) if { x = Enum::B(false); false } => 1,
   |                         ^^^^^^^^^^^^^^^^^^ assignment in pattern guard

error[E0301]: cannot mutably borrow in a pattern guard
  --> $DIR/borrowck-mutate-in-guard.rs:22:38
   |
LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
   |                                      ^ borrowed mutably in pattern guard

error[E0302]: cannot assign in a pattern guard
  --> $DIR/borrowck-mutate-in-guard.rs:22:41
   |
LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
   |                                         ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard

error: aborting due to 3 previous errors

Some errors occurred: E0301, E0302.
For more information about an error, try `rustc --explain E0301`.