1
+ warning[E0503]: cannot use `y` because it was mutably borrowed
2
+ --> $DIR/borrowck-anon-fields-variant.rs:27:7
3
+ |
4
+ LL | Foo::Y(ref mut a, _) => a,
5
+ | --------- borrow of `y.0` occurs here
6
+ ...
7
+ LL | Foo::Y(_, ref mut b) => b,
8
+ | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
9
+ ...
10
+ LL | *a += 1;
11
+ | ------- borrow later used here
12
+ |
13
+ = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
14
+ It represents potential unsoundness in your code.
15
+ This warning will become a hard error in the future.
16
+
17
+ error[E0503]: cannot use `y` because it was mutably borrowed
18
+ --> $DIR/borrowck-anon-fields-variant.rs:44:7
19
+ |
20
+ LL | Foo::Y(ref mut a, _) => a,
21
+ | --------- borrow of `y.0` occurs here
22
+ ...
23
+ LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow
24
+ | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
25
+ ...
26
+ LL | *a += 1;
27
+ | ------- borrow later used here
28
+
1
29
error[E0499]: cannot borrow `y.0` as mutable more than once at a time
2
30
--> $DIR/borrowck-anon-fields-variant.rs:44:14
3
31
|
@@ -10,6 +38,7 @@ LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow
10
38
LL | *a += 1;
11
39
| ------- first borrow later used here
12
40
13
- error: aborting due to previous error
41
+ error: aborting due to 2 previous errors
14
42
15
- For more information about this error, try `rustc --explain E0499`.
43
+ Some errors occurred: E0499, E0503.
44
+ For more information about an error, try `rustc --explain E0499`.
0 commit comments