2018-10-20 23:36:17 +03:00
|
|
|
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
|
2019-01-06 18:33:05 +03:00
|
|
|
--> $DIR/better-expected.rs:2:19
|
2018-10-20 23:36:17 +03:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | let x: [isize 3];
|
Detect more cases of `=` to `:` typo
When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span
arround and mention it. If the type could continue being parsed as an
expression, suggest replacing the `:` with a `=`.
```
error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.`
--> file.rs:2:32
|
2 | let _: std::env::temp_dir().join("foo");
| - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=`
| |
| while parsing the type for `_`
| help: use `=` if you meant to assign
```
Fix #119665.
2024-02-27 00:48:32 +00:00
|
|
|
| - ^ expected one of 7 possible tokens
|
|
|
|
| |
|
|
|
|
| while parsing the type for `x`
|
2018-10-20 23:36:17 +03:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2018-10-20 23:36:17 +03:00
|
|
|
|