mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
da1360d981
Partially address #45405.
26 lines
777 B
Plaintext
26 lines
777 B
Plaintext
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
|
|
--> $DIR/issue-51515.rs:5:5
|
|
|
|
|
LL | *foo = 32;
|
|
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
LL | let foo = &mut 16;
|
|
| ~~~~~~~
|
|
|
|
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
|
|
--> $DIR/issue-51515.rs:9:5
|
|
|
|
|
LL | *bar = 64;
|
|
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
|
|
|
|
|
help: consider specifying this binding's type
|
|
|
|
|
LL | let bar: &mut i32 = foo;
|
|
| ++++++++++
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0594`.
|