2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `self.0`, which is behind a `&` reference
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/suggest-ref-mut.rs:7:9
|
2018-07-11 03:45:25 -07:00
|
|
|
|
|
|
|
|
LL | fn zap(&self) {
|
|
|
|
| ----- help: consider changing this to be a mutable reference: `&mut self`
|
|
|
|
...
|
|
|
|
LL | self.0 = 32;
|
|
|
|
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written
|
|
|
|
|
2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/suggest-ref-mut.rs:16:5
|
2018-07-10 21:31:07 -07:00
|
|
|
|
|
2018-07-10 22:58:43 -07:00
|
|
|
LL | let ref foo = 16;
|
|
|
|
| ------- help: consider changing this to be a mutable reference: `ref mut foo`
|
|
|
|
...
|
2018-07-10 21:31:07 -07:00
|
|
|
LL | *foo = 32;
|
2018-07-10 22:58:43 -07:00
|
|
|
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
|
2018-07-10 21:31:07 -07:00
|
|
|
|
2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/suggest-ref-mut.rs:21:9
|
2018-07-10 21:31:07 -07:00
|
|
|
|
|
2018-07-10 22:58:43 -07:00
|
|
|
LL | if let Some(ref bar) = Some(16) {
|
|
|
|
| ------- help: consider changing this to be a mutable reference: `ref mut bar`
|
|
|
|
...
|
2018-07-10 21:31:07 -07:00
|
|
|
LL | *bar = 32;
|
2018-07-10 22:58:43 -07:00
|
|
|
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
|
2018-07-10 21:31:07 -07:00
|
|
|
|
2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `*quo`, which is behind a `&` reference
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/suggest-ref-mut.rs:25:22
|
2018-07-10 21:31:07 -07:00
|
|
|
|
|
|
|
|
LL | ref quo => { *quo = 32; },
|
2018-07-10 22:58:43 -07:00
|
|
|
| ------- ^^^^^^^^^ `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 21:31:07 -07:00
|
|
|
|
2018-07-11 03:45:25 -07:00
|
|
|
error: aborting due to 4 previous errors
|
2018-07-10 21:31:07 -07:00
|
|
|
|
2019-11-06 13:58:44 +01:00
|
|
|
For more information about this error, try `rustc --explain E0594`.
|