rust/src/test/ui/suggestions/suggest-ref-mut.stderr

30 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-07-10 23:31:07 -05:00
error[E0594]: cannot assign to `*foo` which is behind a `&` reference
--> $DIR/suggest-ref-mut.rs:17:5
|
LL | let ref foo = 16;
| ------- help: consider changing this to be a mutable reference: `ref mut foo`
...
2018-07-10 23:31:07 -05:00
LL | *foo = 32;
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
2018-07-10 23:31:07 -05:00
error[E0594]: cannot assign to `*bar` which is behind a `&` reference
--> $DIR/suggest-ref-mut.rs:22:9
|
LL | if let Some(ref bar) = Some(16) {
| ------- help: consider changing this to be a mutable reference: `ref mut bar`
...
2018-07-10 23:31:07 -05:00
LL | *bar = 32;
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
2018-07-10 23:31:07 -05:00
error[E0594]: cannot assign to `*quo` which is behind a `&` reference
--> $DIR/suggest-ref-mut.rs:26:22
|
LL | ref quo => { *quo = 32; },
| ------- ^^^^^^^^^ `quo` is a `&` reference, so the data it refers to cannot be written
| |
| help: consider changing this to be a mutable reference: `ref mut quo`
2018-07-10 23:31:07 -05:00
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0594`.