forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathborrowck-anon-fields-variant.nll.stderr
More file actions
43 lines (39 loc) · 1.53 KB
/
borrowck-anon-fields-variant.nll.stderr
File metadata and controls
43 lines (39 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
warning[E0503]: cannot use `y` because it was mutably borrowed
--> $DIR/borrowck-anon-fields-variant.rs:27:7
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
...
LL | Foo::Y(_, ref mut b) => b,
| ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
...
LL | *a += 1;
| ------- borrow later used here
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
error[E0503]: cannot use `y` because it was mutably borrowed
--> $DIR/borrowck-anon-fields-variant.rs:44:7
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
...
LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow
| ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
...
LL | *a += 1;
| ------- borrow later used here
error[E0499]: cannot borrow `y.0` as mutable more than once at a time
--> $DIR/borrowck-anon-fields-variant.rs:44:14
|
LL | Foo::Y(ref mut a, _) => a,
| --------- first mutable borrow occurs here
...
LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow
| ^^^^^^^^^ second mutable borrow occurs here
...
LL | *a += 1;
| ------- first borrow later used here
error: aborting due to 2 previous errors
Some errors occurred: E0499, E0503.
For more information about an error, try `rustc --explain E0499`.