rust/tests/ui/borrowck/borrowck-issue-14498.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

104 lines
3.2 KiB
Plaintext
Raw Normal View History

error[E0594]: cannot assign to `***p`, which is behind a `&` reference
--> $DIR/borrowck-issue-14498.rs:16:5
2018-08-08 07:28:26 -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
|
help: consider changing this to be a mutable reference
|
LL | let p = &mut y;
| ~~~~~~
2018-08-08 07:28:26 -05:00
error[E0506]: cannot assign to `**y` because it is borrowed
--> $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;
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
--> $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;
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
--> $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;
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
--> $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;
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
--> $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;
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
--> $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;
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
--> $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;
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
--> $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;
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`.