2019-06-25 10:55:32 -04:00
|
|
|
error[E0506]: cannot assign to `a` because it is borrowed
|
2019-08-02 03:48:43 +02:00
|
|
|
--> $DIR/ret-ref.rs:16:5
|
2019-06-25 10:55:32 -04:00
|
|
|
|
|
|
|
|
LL | let future = multiple_named_lifetimes(&a, &b);
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `a` is borrowed here
|
2019-06-25 10:55:32 -04:00
|
|
|
LL | a += 1;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^ `a` is assigned to here but it was already borrowed
|
2019-06-25 10:55:32 -04: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-02 03:48:43 +02:00
|
|
|
--> $DIR/ret-ref.rs:17:5
|
2019-06-25 10:55:32 -04:00
|
|
|
|
|
|
|
|
LL | let future = multiple_named_lifetimes(&a, &b);
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `b` is borrowed here
|
2019-06-25 10:55:32 -04:00
|
|
|
LL | a += 1;
|
|
|
|
LL | b += 1;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^ `b` is assigned to here but it was already borrowed
|
2019-06-25 10:55:32 -04:00
|
|
|
LL | let p = future.await;
|
|
|
|
| ------ borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `a` because it is borrowed
|
2019-08-02 03:48:43 +02:00
|
|
|
--> $DIR/ret-ref.rs:28:5
|
2019-06-25 10:55:32 -04:00
|
|
|
|
|
|
|
|
LL | let future = multiple_named_lifetimes(&a, &b);
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `a` is borrowed here
|
2019-06-25 10:55:32 -04:00
|
|
|
LL | let p = future.await;
|
|
|
|
LL | a += 1;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^ `a` is assigned to here but it was already borrowed
|
2019-06-25 10:55:32 -04: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`.
|