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