]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr
New upstream version 1.39.0+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-anon-fields-variant.nll.stderr
CommitLineData
48663c56 1error[E0503]: cannot use `y` because it was mutably borrowed
0731742a
XL
2 --> $DIR/borrowck-anon-fields-variant.rs:17:7
3 |
4LL | Foo::Y(ref mut a, _) => a,
5 | --------- borrow of `y.0` occurs here
6...
7LL | Foo::Y(_, ref mut b) => b,
8 | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
9...
10LL | *a += 1;
11 | ------- borrow later used here
0731742a
XL
12
13error[E0503]: cannot use `y` because it was mutably borrowed
48663c56 14 --> $DIR/borrowck-anon-fields-variant.rs:37:7
0731742a
XL
15 |
16LL | Foo::Y(ref mut a, _) => a,
17 | --------- borrow of `y.0` occurs here
18...
532ac7d7 19LL | Foo::Y(ref mut b, _) => b,
0731742a
XL
20 | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
21...
22LL | *a += 1;
23 | ------- borrow later used here
24
b7449926 25error[E0499]: cannot borrow `y.0` as mutable more than once at a time
48663c56 26 --> $DIR/borrowck-anon-fields-variant.rs:37:14
b7449926
XL
27 |
28LL | Foo::Y(ref mut a, _) => a,
29 | --------- first mutable borrow occurs here
30...
532ac7d7 31LL | Foo::Y(ref mut b, _) => b,
b7449926
XL
32 | ^^^^^^^^^ second mutable borrow occurs here
33...
34LL | *a += 1;
0bf4aa26 35 | ------- first borrow later used here
b7449926 36
48663c56 37error: aborting due to 3 previous errors
b7449926 38
48663c56 39Some errors have detailed explanations: E0499, E0503.
0731742a 40For more information about an error, try `rustc --explain E0499`.