Closed Giga-Bowser closed 6 days ago
We might want to parse these so we can offer diagnostics like rustc
: "error: an fn
pointer type cannot be async
".
That diagnostic is offered as it stands, with an accompanying assist, although with a lot of cruft afterwards. We could probably just eat the tokens to fix this. Is there a reason to emit a proper error from the parser rather than relying on the diagnostic from rustc
?
I like to disable check
and rely on the native r-a diagnostics. They're (arguably) faster, and get displayed on-the-fly, not just when saving the file.
Ideally, we would be able to reuse the rustc diagnostic. Not going to happen, but we do have a couple of them implemented.
Whoops, of course I pushed that right before seeing your reply. I'll eventually make a new PR to generate a proper rust-analyzer diagnostic for this. For now, I'll just close this and handle this stuff there.
Rust doesn't support
const
orasync
function pointers, nor does our parser.