@@ -849,7 +849,7 @@ impl<'a> Parser<'a> {
849
849
850
850
/// Assuming we have just parsed `.`, continue parsing into an expression.
851
851
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 ) {
853
853
return self . mk_await_expr ( self_arg, lo) ;
854
854
}
855
855
@@ -963,7 +963,7 @@ impl<'a> Parser<'a> {
963
963
// | ^ expected expression
964
964
self . bump ( ) ;
965
965
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 ( ) {
967
967
// `Span::rust_2018()` is somewhat expensive; don't get it repeatedly.
968
968
if self . check_keyword ( kw:: Async ) {
969
969
if self . is_async_block ( ) {
@@ -1396,11 +1396,14 @@ impl<'a> Parser<'a> {
1396
1396
let movability =
1397
1397
if self . eat_keyword ( kw:: Static ) { Movability :: Static } else { Movability :: Movable } ;
1398
1398
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 {
1402
1405
// 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) ;
1404
1407
}
1405
1408
1406
1409
let capture_clause = self . parse_capture_clause ( ) ;
@@ -1756,7 +1759,7 @@ impl<'a> Parser<'a> {
1756
1759
fn is_try_block ( & self ) -> bool {
1757
1760
self . token . is_keyword ( kw:: Try ) &&
1758
1761
self . look_ahead ( 1 , |t| * t == token:: OpenDelim ( token:: Brace ) ) &&
1759
- self . normalized_token . span . rust_2018 ( ) &&
1762
+ self . token . uninterpolated_span ( ) . rust_2018 ( ) &&
1760
1763
// Prevent `while try {} {}`, `if try {} {} else {}`, etc.
1761
1764
!self . restrictions . contains ( Restrictions :: NO_STRUCT_LITERAL )
1762
1765
}
0 commit comments