2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
|
2019-04-07 15:07:36 +00:00
|
|
|
--> $DIR/issue-51515.rs:5:5
|
2018-07-09 20:16:02 +00:00
|
|
|
|
|
|
|
|
LL | *foo = 32;
|
|
|
|
| ^^^^^^^^^ `foo` 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 foo = &mut 16;
|
|
|
|
| ~~~~~~~
|
2018-07-09 20:16:02 +00:00
|
|
|
|
2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
|
2023-02-03 18:53:27 +00:00
|
|
|
--> $DIR/issue-51515.rs:9:5
|
2018-07-09 20:16:02 +00:00
|
|
|
|
|
|
|
|
LL | *bar = 64;
|
|
|
|
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
|
2023-02-03 18:53:27 +00:00
|
|
|
|
|
|
|
|
help: consider specifying this binding's type
|
|
|
|
|
|
|
|
|
LL | let bar: &mut i32 = foo;
|
|
|
|
| ++++++++++
|
2018-07-09 20:16:02 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2019-11-06 12:58:44 +00:00
|
|
|
For more information about this error, try `rustc --explain E0594`.
|