2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `*input`, which is behind a `&` reference
|
2021-05-09 05:26:59 +04:30
|
|
|
--> $DIR/issue-68049-2.rs:9:7
|
|
|
|
|
|
|
|
|
LL | *input = self.0;
|
|
|
|
| ^^^^^^^^^^^^^^^ `input` is a `&` reference, so the data it refers to cannot be written
|
2022-12-28 21:52:57 -08:00
|
|
|
|
|
2024-04-05 23:27:58 +00:00
|
|
|
help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition
|
2022-12-28 21:52:57 -08:00
|
|
|
|
|
2024-04-05 23:27:58 +00:00
|
|
|
LL | fn example(&self, input: &mut i32) {
|
2023-04-21 23:49:05 +12:00
|
|
|
| +++
|
2021-05-09 05:26:59 +04:30
|
|
|
|
2021-07-02 18:29:49 +02:00
|
|
|
error[E0594]: cannot assign to `self.0`, which is behind a `&` reference
|
2021-05-09 05:26:59 +04:30
|
|
|
--> $DIR/issue-68049-2.rs:17:5
|
|
|
|
|
|
|
|
|
LL | self.0 += *input;
|
|
|
|
| ^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written
|
2022-12-28 21:52:57 -08:00
|
|
|
|
|
2024-04-05 23:27:58 +00:00
|
|
|
help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition
|
|
|
|
|
|
|
|
|
LL ~ fn example(&mut self, input: &i32);
|
|
|
|
LL | }
|
2024-06-20 04:25:17 +00:00
|
|
|
...
|
2024-04-05 23:27:58 +00:00
|
|
|
LL | impl Hello for Test2 {
|
|
|
|
LL ~ fn example(&mut self, input: &i32) {
|
2022-12-28 21:52:57 -08:00
|
|
|
|
|
2021-05-09 05:26:59 +04:30
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0594`.
|