File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,7 @@ impl TokenKind {
295
295
match * self {
296
296
Comma => Some ( vec ! [ Dot , Lt , Semi ] ) ,
297
297
Semi => Some ( vec ! [ Colon , Comma ] ) ,
298
+ FatArrow => Some ( vec ! [ Eq , RArrow ] ) ,
298
299
_ => None ,
299
300
}
300
301
}
Original file line number Diff line number Diff line change @@ -2324,7 +2324,10 @@ impl<'a> Parser<'a> {
2324
2324
let arrow_span = this. token . span ;
2325
2325
if let Err ( mut err) = this. expect ( & token:: FatArrow ) {
2326
2326
// We might have a `=>` -> `=` or `->` typo (issue #89396).
2327
- if let token:: Eq | token:: RArrow = this. token . kind {
2327
+ if TokenKind :: FatArrow
2328
+ . similar_tokens ( )
2329
+ . map_or ( false , |similar_tokens| similar_tokens. contains ( & this. token . kind ) )
2330
+ {
2328
2331
err. span_suggestion (
2329
2332
this. token . span ,
2330
2333
"try using a fat arrow here" ,
You can’t perform that action at this time.
0 commit comments