]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-anon-fields-variant.stderr
New upstream version 1.36.0+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-anon-fields-variant.stderr
1 warning[E0503]: cannot use `y` because it was mutably borrowed
2 --> $DIR/borrowck-anon-fields-variant.rs:17: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 = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
15
16 error[E0503]: cannot use `y` because it was mutably borrowed
17 --> $DIR/borrowck-anon-fields-variant.rs:37:7
18 |
19 LL | Foo::Y(ref mut a, _) => a,
20 | --------- borrow of `y.0` occurs here
21 ...
22 LL | Foo::Y(ref mut b, _) => b,
23 | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
24 ...
25 LL | *a += 1;
26 | ------- borrow later used here
27
28 error[E0499]: cannot borrow `y.0` as mutable more than once at a time
29 --> $DIR/borrowck-anon-fields-variant.rs:37:14
30 |
31 LL | Foo::Y(ref mut a, _) => a,
32 | --------- first mutable borrow occurs here
33 ...
34 LL | Foo::Y(ref mut b, _) => b,
35 | ^^^^^^^^^ second mutable borrow occurs here
36 ...
37 LL | *a += 1;
38 | ------- first borrow later used here
39
40 error: aborting due to 2 previous errors
41
42 Some errors have detailed explanations: E0499, E0503.
43 For more information about an error, try `rustc --explain E0499`.