Open tyrone-wu opened 5 hours ago
After looking into FnPointerCannotBeConst
and FnPointerCannotBeAsync
, is there a reason the diagnostic need the whole_span
?
Maybe a better visual indicator could be to only highlight the offending Span
, something like this:
1 | type FOO = const async fn();
| ^^^^^
|
help: remove the `const` qualifier
...
1 | type FOO = const async fn();
| ^^^^^
|
help: remove the `async` qualifier
I see the suggestion is maybe-incorrect
, so perhaps highlighting the whole_span
could be beneficial, although I'm not sure what it would look like when the suggestion is actually incorrect.
Code
Current output
Desired output
Rationale and extra context
The suggestion of the current output produces an extra whitespace for each invalid qualifier.
Ideally, the desired output should fully remove the qualifier and following whitespaces up until the next token.
Other cases
Rust Version
Anything else?
No response