Point at LHS on binop type err if relevant

This commit is contained in:
Esteban Küber 2022-12-02 15:56:37 -08:00
parent 01fbc5ae78
commit 132a140214
14 changed files with 571 additions and 187 deletions

View file

@ -34,7 +34,9 @@ error[E0308]: mismatched types
--> $DIR/bare-struct-body.rs:11:14
|
LL | x.val == 42;
| ^^ expected `()`, found integer
| ----- ^^ expected `()`, found integer
| |
| expected because this is `()`
error: aborting due to 3 previous errors

View file

@ -123,37 +123,49 @@ error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:4:14
|
LL | 1 < 2 <= 3;
| ^ expected `bool`, found integer
| ----- ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:13:14
|
LL | 1 <= 2 < 3;
| ^ expected `bool`, found integer
| ------ ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:18:15
|
LL | 1 <= 2 <= 3;
| ^ expected `bool`, found integer
| ------ ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:23:14
|
LL | 1 > 2 >= 3;
| ^ expected `bool`, found integer
| ----- ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:36:15
|
LL | 1 >= 2 >= 3;
| ^ expected `bool`, found integer
| ------ ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:49:15
|
LL | 1 == 2 == 3;
| ^ expected `bool`, found integer
| ------ ^ expected `bool`, found integer
| |
| expected because this is `bool`
error: aborting due to 17 previous errors