rust/tests/ui/issues/issue-51515.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
774 B
Plaintext
Raw Normal View History

error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
--> $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
|
help: consider changing this to be a mutable reference
|
LL | let foo = &mut 16;
| +++
2018-07-09 15:16:02 -05:00
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
--> $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
|
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`.