2018-07-09 13:16:02 -07:00
|
|
|
error[E0594]: cannot assign to `*foo` which is behind a `&` reference
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/issue-51515.rs:5:5
|
2018-07-09 13:16:02 -07:00
|
|
|
|
|
|
|
|
|
LL | let foo = &16;
|
|
|
|
|
| --- help: consider changing this to be a mutable reference: `&mut 16`
|
2018-07-09 13:33:57 -07:00
|
|
|
...
|
2018-07-09 13:16:02 -07:00
|
|
|
LL | *foo = 32;
|
|
|
|
|
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
|
|
|
|
|
|
|
|
|
|
error[E0594]: cannot assign to `*bar` which is behind a `&` reference
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/issue-51515.rs:10:5
|
2018-07-09 13:16:02 -07:00
|
|
|
|
|
2018-07-09 13:33:57 -07:00
|
|
|
LL | let bar = foo;
|
|
|
|
|
| --- help: consider changing this to be a mutable reference: `&mut i32`
|
|
|
|
|
...
|
2018-07-09 13:16:02 -07:00
|
|
|
LL | *bar = 64;
|
|
|
|
|
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
|
|
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
2019-11-06 13:58:44 +01:00
|
|
|
For more information about this error, try `rustc --explain E0594`.
|