File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,7 @@ impl TokenKind {
295295 match * self {
296296 Comma => Some ( vec ! [ Dot , Lt , Semi ] ) ,
297297 Semi => Some ( vec ! [ Colon , Comma ] ) ,
298+ FatArrow => Some ( vec ! [ Eq , RArrow ] ) ,
298299 _ => None ,
299300 }
300301 }
Original file line number Diff line number Diff line change @@ -2324,7 +2324,10 @@ impl<'a> Parser<'a> {
23242324 let arrow_span = this. token . span ;
23252325 if let Err ( mut err) = this. expect ( & token:: FatArrow ) {
23262326 // 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+ {
23282331 err. span_suggestion (
23292332 this. token . span ,
23302333 "try using a fat arrow here" ,
You can’t perform that action at this time.
0 commit comments