Open
Description
Code
pub enum Foo {
X, Y
}
pub fn invert(foo: Foo) -> Foo {
use Foo::*;
match foo {
X => Y.
Y => X,
}
}
Current output
error: expected one of `(`, `,`, `.`, `::`, `?`, `}`, or an operator, found `=>`
--> src/lib.rs:12:11
|
12 | Y => X,
| ^^ expected one of 7 possible tokens
warning: unused import: `Foo::*`
Desired output
I wish it would have tried error recovery by substituting "," where it saw a ".", which is a reasonable enough typo, so that it could give some kind of hint that maybe the previous line had been intended to be Y,
not Y.
.
Rationale and extra context
No response
Other cases
Rust Version
I don't have rust installed locally, this was 1.86 in the rust playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1eb7427edcf893496f899d59f78ec1ff
Anything else?
No response