Relocate issues/issue-51154.rs to closures/box-generic-closure.rs Relocate issues/issue-51515.rs to borrowck/assignment-to-immutable-ref.rs Relocate issues/issue-53348.rs to mismatched_types/deref-string-assign.rs Relocate issues/issue-52717.rs to pattern/match-enum-struct-variant-field-missing.rs Relocate issues/issue-53300.rs to type/cannot-find-wrapper-with-impl-trait.rs
25 lines
775 B
Text
25 lines
775 B
Text
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
|
|
--> $DIR/assignment-to-immutable-ref.rs:8:5
|
|
|
|
|
LL | *foo = 32;
|
|
| ^^^^^^^^^ `foo` is a `&` reference, so it cannot be written to
|
|
|
|
|
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/assignment-to-immutable-ref.rs:12:5
|
|
|
|
|
LL | *bar = 64;
|
|
| ^^^^^^^^^ `bar` is a `&` reference, so it cannot be written to
|
|
|
|
|
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`.
|