1
Fork 0

Improve error reporting for modifications behind & references

This commit is contained in:
Fabian Wolff 2021-07-02 18:29:49 +02:00
parent ce331ee6ee
commit 5eb83f4ec3
34 changed files with 90 additions and 57 deletions

View file

@ -1,16 +1,16 @@
error[E0594]: cannot assign to `*x` which is behind a `&` reference
error[E0594]: cannot assign to `*x`, which is behind a `&` reference
--> $DIR/enum.rs:9:5
|
LL | *x += 1;
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
error[E0594]: cannot assign to `*x` which is behind a `&` reference
error[E0594]: cannot assign to `*x`, which is behind a `&` reference
--> $DIR/enum.rs:13:9
|
LL | *x += 1;
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
error[E0594]: cannot assign to `*x` which is behind a `&` reference
error[E0594]: cannot assign to `*x`, which is behind a `&` reference
--> $DIR/enum.rs:19:9
|
LL | *x += 1;