2021-07-02 11:29:49 -05:00
|
|
|
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/issue-51515.rs:5: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;
|
|
|
|
| ~~~~~~~
|
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
|
2022-06-27 22:23:24 -05:00
|
|
|
--> $DIR/issue-51515.rs:8:5
|
2018-07-09 15:16:02 -05:00
|
|
|
|
|
2018-07-09 15:33:57 -05:00
|
|
|
LL | let bar = foo;
|
2022-06-27 22:23:24 -05:00
|
|
|
| --- consider changing this binding's type to be: `&mut i32`
|
2018-07-09 15:16:02 -05: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 06:58:44 -06:00
|
|
|
For more information about this error, try `rustc --explain E0594`.
|