@@ -849,7 +849,7 @@ impl<'a> Parser<'a> {
849849
850850 /// Assuming we have just parsed `.`, continue parsing into an expression.
851851 fn parse_dot_suffix ( & mut self , self_arg : P < Expr > , lo : Span ) -> PResult < ' a , P < Expr > > {
852- if self . normalized_token . span . rust_2018 ( ) && self . eat_keyword ( kw:: Await ) {
852+ if self . token . uninterpolated_span ( ) . rust_2018 ( ) && self . eat_keyword ( kw:: Await ) {
853853 return self . mk_await_expr ( self_arg, lo) ;
854854 }
855855
@@ -963,7 +963,7 @@ impl<'a> Parser<'a> {
963963 // | ^ expected expression
964964 self . bump ( ) ;
965965 Ok ( self . mk_expr_err ( self . token . span ) )
966- } else if self . normalized_token . span . rust_2018 ( ) {
966+ } else if self . token . uninterpolated_span ( ) . rust_2018 ( ) {
967967 // `Span::rust_2018()` is somewhat expensive; don't get it repeatedly.
968968 if self . check_keyword ( kw:: Async ) {
969969 if self . is_async_block ( ) {
@@ -1396,11 +1396,14 @@ impl<'a> Parser<'a> {
13961396 let movability =
13971397 if self . eat_keyword ( kw:: Static ) { Movability :: Static } else { Movability :: Movable } ;
13981398
1399- let asyncness =
1400- if self . normalized_token . span . rust_2018 ( ) { self . parse_asyncness ( ) } else { Async :: No } ;
1401- if asyncness. is_async ( ) {
1399+ let asyncness = if self . token . uninterpolated_span ( ) . rust_2018 ( ) {
1400+ self . parse_asyncness ( )
1401+ } else {
1402+ Async :: No
1403+ } ;
1404+ if let Async :: Yes { span, .. } = asyncness {
14021405 // Feature-gate `async ||` closures.
1403- self . sess . gated_spans . gate ( sym:: async_closure, self . normalized_prev_token . span ) ;
1406+ self . sess . gated_spans . gate ( sym:: async_closure, span) ;
14041407 }
14051408
14061409 let capture_clause = self . parse_capture_clause ( ) ;
@@ -1756,7 +1759,7 @@ impl<'a> Parser<'a> {
17561759 fn is_try_block ( & self ) -> bool {
17571760 self . token . is_keyword ( kw:: Try ) &&
17581761 self . look_ahead ( 1 , |t| * t == token:: OpenDelim ( token:: Brace ) ) &&
1759- self . normalized_token . span . rust_2018 ( ) &&
1762+ self . token . uninterpolated_span ( ) . rust_2018 ( ) &&
17601763 // Prevent `while try {} {}`, `if try {} {} else {}`, etc.
17611764 !self . restrictions . contains ( Restrictions :: NO_STRUCT_LITERAL )
17621765 }
0 commit comments