]>
Commit | Line | Data |
---|---|---|
dc9dc135 | 1 | error[E0506]: cannot assign to `a` because it is borrowed |
e1599b0c | 2 | --> $DIR/ret-ref.rs:16:5 |
dc9dc135 XL |
3 | | |
4 | LL | let future = multiple_named_lifetimes(&a, &b); | |
5 | | -- borrow of `a` occurs here | |
6 | LL | a += 1; | |
7 | | ^^^^^^ assignment to borrowed `a` occurs here | |
8 | LL | b += 1; | |
9 | LL | let p = future.await; | |
10 | | ------ borrow later used here | |
11 | ||
12 | error[E0506]: cannot assign to `b` because it is borrowed | |
e1599b0c | 13 | --> $DIR/ret-ref.rs:17:5 |
dc9dc135 XL |
14 | | |
15 | LL | let future = multiple_named_lifetimes(&a, &b); | |
16 | | -- borrow of `b` occurs here | |
17 | LL | a += 1; | |
18 | LL | b += 1; | |
19 | | ^^^^^^ assignment to borrowed `b` occurs here | |
20 | LL | let p = future.await; | |
21 | | ------ borrow later used here | |
22 | ||
23 | error[E0506]: cannot assign to `a` because it is borrowed | |
e1599b0c | 24 | --> $DIR/ret-ref.rs:28:5 |
dc9dc135 XL |
25 | | |
26 | LL | let future = multiple_named_lifetimes(&a, &b); | |
27 | | -- borrow of `a` occurs here | |
28 | LL | let p = future.await; | |
29 | LL | a += 1; | |
30 | | ^^^^^^ assignment to borrowed `a` occurs here | |
31 | LL | b += 1; | |
32 | LL | drop(p); | |
33 | | - borrow later used here | |
34 | ||
35 | error: aborting due to 3 previous errors | |
36 | ||
37 | For more information about this error, try `rustc --explain E0506`. |