2023-10-27 20:12:45 +00:00
|
|
|
error: missing parameters for function definition
|
2019-01-06 15:33:05 +00:00
|
|
|
--> $DIR/removed-syntax-fn-sigil.rs:2:14
|
2018-10-20 20:36:17 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let x: fn~() = || ();
|
2024-07-06 03:07:46 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
help: add a parameter list
|
|
|
|
|
|
|
|
|
LL | let x: fn()~() = || ();
|
|
|
|
| ++
|
2018-10-20 20:36:17 +00:00
|
|
|
|
2023-10-27 20:12:45 +00:00
|
|
|
error: expected one of `->`, `;`, or `=`, found `~`
|
|
|
|
--> $DIR/removed-syntax-fn-sigil.rs:2:14
|
|
|
|
|
|
|
|
|
LL | let x: fn~() = || ();
|
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 `->`, `;`, or `=`
|
|
|
|
| |
|
|
|
|
| while parsing the type for `x`
|
2023-10-27 20:12:45 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2018-10-20 20:36:17 +00:00
|
|
|
|