2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `***p`, which is behind a `&` reference
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:16:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | ***p = 2;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written
|
2022-12-29 05:52:57 +00:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | let p = &mut y;
|
2023-04-19 06:22:03 +00:00
|
|
|
| +++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:25:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y;
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `**y` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^ `**y` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:35:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y;
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `**y` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^ `**y` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:45:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y;
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `**y` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^ `**y` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:55:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y;
|
2023-01-15 03:06:44 +00:00
|
|
|
| -- `**y` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^ `**y` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:65:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y.a;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ---- `**y.a` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y.a = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^^^ `**y.a` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:75:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y.a;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ---- `**y.a` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y.a = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^^^ `**y.a` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:85:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y.a;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ---- `**y.a` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y.a = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^^^ `**y.a` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-issue-14498.rs:95:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let p = &y.a;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ---- `**y.a` is borrowed here
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let q = &***p;
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | **y.a = 2;
|
2023-01-15 03:06:44 +00:00
|
|
|
| ^^^^^^^^^ `**y.a` is assigned to here but it was already borrowed
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | drop(p);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|
2019-11-06 12:58:44 +00:00
|
|
|
Some errors have detailed explanations: E0506, E0594.
|
|
|
|
For more information about an error, try `rustc --explain E0506`.
|