Improve invalid assignment error
This commit is contained in:
parent
a5991c57cf
commit
b7bfdbe681
15 changed files with 92 additions and 49 deletions
|
|
@ -8,11 +8,13 @@ LL | LinkedList::new() += 1;
|
|||
|
|
||||
= note: an implementation of `std::ops::AddAssign` might be missing for `std::collections::LinkedList<_>`
|
||||
|
||||
error[E0067]: invalid left-hand side expression
|
||||
--> $DIR/E0067.rs:4:5
|
||||
error[E0067]: invalid left-hand side of assignment
|
||||
--> $DIR/E0067.rs:4:23
|
||||
|
|
||||
LL | LinkedList::new() += 1;
|
||||
| ^^^^^^^^^^^^^^^^^ invalid expression for left-hand side
|
||||
| ----------------- ^^
|
||||
| |
|
||||
| cannot assign to this expression
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
error[E0070]: invalid left-hand side expression
|
||||
error[E0070]: invalid left-hand side of assignment
|
||||
--> $DIR/E0070.rs:6:5
|
||||
|
|
||||
LL | SOME_CONST = 14;
|
||||
| ^^^^^^^^^^^^^^^ left-hand of expression not valid
|
||||
| ----------^^^^^
|
||||
| |
|
||||
| cannot assign to this expression
|
||||
|
||||
error[E0070]: invalid left-hand side expression
|
||||
error[E0070]: invalid left-hand side of assignment
|
||||
--> $DIR/E0070.rs:7:5
|
||||
|
|
||||
LL | 1 = 3;
|
||||
| ^^^^^ left-hand of expression not valid
|
||||
| -^^^^
|
||||
| |
|
||||
| cannot assign to this expression
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/E0070.rs:8:25
|
||||
|
|
@ -16,11 +20,13 @@ error[E0308]: mismatched types
|
|||
LL | some_other_func() = 4;
|
||||
| ^ expected `()`, found integer
|
||||
|
||||
error[E0070]: invalid left-hand side expression
|
||||
error[E0070]: invalid left-hand side of assignment
|
||||
--> $DIR/E0070.rs:8:5
|
||||
|
|
||||
LL | some_other_func() = 4;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ left-hand of expression not valid
|
||||
| -----------------^^^^
|
||||
| |
|
||||
| cannot assign to this expression
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue