@@ -8,7 +8,7 @@ use crate::DirectoryOwnership;
88
99use rustc_errors:: { Applicability , PResult } ;
1010use rustc_span:: source_map:: { BytePos , Span } ;
11- use rustc_span:: symbol:: { kw, sym, Symbol } ;
11+ use rustc_span:: symbol:: { kw, sym} ;
1212use syntax:: ast;
1313use syntax:: ast:: { AttrStyle , AttrVec , Attribute , Mac , MacStmtStyle } ;
1414use syntax:: ast:: { Block , BlockCheckMode , Expr , ExprKind , Local , Stmt , StmtKind , DUMMY_NODE_ID } ;
@@ -55,13 +55,11 @@ impl<'a> Parser<'a> {
5555 return self . recover_stmt_local ( lo, attrs. into ( ) , msg, "let" ) ;
5656 }
5757
58- // Starts like a simple path, being careful to avoid contextual keywords
59- // such as a union items, item with `crate` visibility or auto trait items.
60- // Our goal here is to parse an arbitrary path `a::b::c` but not something that starts
61- // like a path (1 token), but it fact not a path.
62- if self . token . is_path_start ( )
63- && !self . token . is_qpath_start ( )
64- && !self . is_path_start_item ( ) // Confirm we don't steal syntax from `parse_item_`.
58+ // Starts like a simple path, being careful to avoid contextual keywords,
59+ // e.g., `union`, items with `crate` visibility, or `auto trait` items.
60+ // We aim to parse an arbitrary path `a::b` but not something that starts like a path
61+ // (1 token), but it fact not a path. Also, we avoid stealing syntax from `parse_item_`.
62+ if self . token . is_path_start ( ) && !self . token . is_qpath_start ( ) && !self . is_path_start_item ( )
6563 {
6664 let path = self . parse_path ( PathStyle :: Expr ) ?;
6765
@@ -191,10 +189,6 @@ impl<'a> Parser<'a> {
191189 }
192190 }
193191
194- fn is_kw_followed_by_ident ( & self , kw : Symbol ) -> bool {
195- self . token . is_keyword ( kw) && self . look_ahead ( 1 , |t| t. is_ident ( ) && !t. is_reserved_ident ( ) )
196- }
197-
198192 fn recover_stmt_local (
199193 & mut self ,
200194 lo : Span ,
0 commit comments