2019-06-25 09:55:32 -05:00
|
|
|
error[E0506]: cannot assign to `a` because it is borrowed
|
2019-08-01 20:48:43 -05:00
|
|
|
--> $DIR/ret-ref.rs:16:5
|
2019-06-25 09:55:32 -05:00
|
|
|
|
|
|
|
|
LL | let future = multiple_named_lifetimes(&a, &b);
|
2023-01-14 21:06:44 -06:00
|
|
|
| -- `a` is borrowed here
|
2019-06-25 09:55:32 -05:00
|
|
|
LL | a += 1;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^^ `a` is assigned to here but it was already borrowed
|
2019-06-25 09:55:32 -05:00
|
|
|
LL | b += 1;
|
|
|
|
LL | let p = future.await;
|
|
|
|
| ------ borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `b` because it is borrowed
|
2019-08-01 20:48:43 -05:00
|
|
|
--> $DIR/ret-ref.rs:17:5
|
2019-06-25 09:55:32 -05:00
|
|
|
|
|
|
|
|
LL | let future = multiple_named_lifetimes(&a, &b);
|
2023-01-14 21:06:44 -06:00
|
|
|
| -- `b` is borrowed here
|
2019-06-25 09:55:32 -05:00
|
|
|
LL | a += 1;
|
|
|
|
LL | b += 1;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^^ `b` is assigned to here but it was already borrowed
|
2019-06-25 09:55:32 -05:00
|
|
|
LL | let p = future.await;
|
|
|
|
| ------ borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `a` because it is borrowed
|
2019-08-01 20:48:43 -05:00
|
|
|
--> $DIR/ret-ref.rs:28:5
|
2019-06-25 09:55:32 -05:00
|
|
|
|
|
|
|
|
LL | let future = multiple_named_lifetimes(&a, &b);
|
2023-01-14 21:06:44 -06:00
|
|
|
| -- `a` is borrowed here
|
2019-06-25 09:55:32 -05:00
|
|
|
LL | let p = future.await;
|
|
|
|
LL | a += 1;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^^ `a` is assigned to here but it was already borrowed
|
2019-06-25 09:55:32 -05:00
|
|
|
LL | b += 1;
|
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0506`.
|