2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
|
2023-04-19 18:22:03 +12:00
|
|
|
--> $DIR/issue-51515.rs:4:5
|
2018-07-09 13:16:02 -07:00
|
|
|
|
|
|
|
|
LL | *foo = 32;
|
|
|
|
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
|
2022-12-28 21:52:57 -08:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | let foo = &mut 16;
|
2023-04-19 18:22:03 +12:00
|
|
|
| +++
|
2018-07-09 13:16:02 -07:00
|
|
|
|
2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
|
2023-04-19 18:22:03 +12:00
|
|
|
--> $DIR/issue-51515.rs:8:5
|
2018-07-09 13:16:02 -07: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 13:16:02 -07:00
|
|
|
|
|
|
|
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`.
|