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