@@ -8423,6 +8423,8 @@ impl<'a> Parser<'a> {
8423
8423
for ( index, input) in decl. inputs . iter_mut ( ) . enumerate ( ) {
8424
8424
let id = ast:: DUMMY_NODE_ID ;
8425
8425
let span = input. pat . span ;
8426
+ let desugared_span = self . sess . source_map ( )
8427
+ . mark_span_with_reason ( CompilerDesugaringKind :: Async , span, None ) ;
8426
8428
8427
8429
// Construct a name for our temporary argument.
8428
8430
let name = format ! ( "__arg{}" , index) ;
@@ -8439,8 +8441,7 @@ impl<'a> Parser<'a> {
8439
8441
// this would affect the input to procedural macros, but they can have
8440
8442
// their span marked as being the result of a compiler desugaring so
8441
8443
// that they aren't linted against.
8442
- input. pat . span = self . sess . source_map ( ) . mark_span_with_reason (
8443
- CompilerDesugaringKind :: Async , span, None ) ;
8444
+ input. pat . span = desugared_span;
8444
8445
8445
8446
( binding_mode, ident, true )
8446
8447
}
@@ -8460,7 +8461,7 @@ impl<'a> Parser<'a> {
8460
8461
node : PatKind :: Ident (
8461
8462
BindingMode :: ByValue ( Mutability :: Immutable ) , ident, None ,
8462
8463
) ,
8463
- span,
8464
+ span : desugared_span ,
8464
8465
} ) ,
8465
8466
source : ArgSource :: AsyncFn ( input. pat . clone ( ) ) ,
8466
8467
} )
@@ -8473,7 +8474,7 @@ impl<'a> Parser<'a> {
8473
8474
pat : P ( Pat {
8474
8475
id,
8475
8476
node : PatKind :: Ident ( binding_mode, ident, None ) ,
8476
- span,
8477
+ span : desugared_span ,
8477
8478
} ) ,
8478
8479
// We explicitly do not specify the type for this statement. When the user's
8479
8480
// argument type is `impl Trait` then this would require the
0 commit comments