@@ -1556,7 +1556,7 @@ impl<'a> Parser<'a> {
1556
1556
fn parse_match_expr ( & mut self , mut attrs : AttrVec ) -> PResult < ' a , P < Expr > > {
1557
1557
let match_span = self . prev_span ;
1558
1558
let lo = self . prev_span ;
1559
- let discriminant = self . parse_expr_res ( Restrictions :: NO_STRUCT_LITERAL , None ) ?;
1559
+ let scrutinee = self . parse_expr_res ( Restrictions :: NO_STRUCT_LITERAL , None ) ?;
1560
1560
if let Err ( mut e) = self . expect ( & token:: OpenDelim ( token:: Brace ) ) {
1561
1561
if self . token == token:: Semi {
1562
1562
e. span_suggestion_short (
@@ -1582,13 +1582,13 @@ impl<'a> Parser<'a> {
1582
1582
if self . token == token:: CloseDelim ( token:: Brace ) {
1583
1583
self . bump ( ) ;
1584
1584
}
1585
- return Ok ( self . mk_expr ( span, ExprKind :: Match ( discriminant , arms) , attrs) ) ;
1585
+ return Ok ( self . mk_expr ( span, ExprKind :: Match ( scrutinee , arms) , attrs) ) ;
1586
1586
}
1587
1587
}
1588
1588
}
1589
1589
let hi = self . token . span ;
1590
1590
self . bump ( ) ;
1591
- return Ok ( self . mk_expr ( lo. to ( hi) , ExprKind :: Match ( discriminant , arms) , attrs) ) ;
1591
+ return Ok ( self . mk_expr ( lo. to ( hi) , ExprKind :: Match ( scrutinee , arms) , attrs) ) ;
1592
1592
}
1593
1593
1594
1594
pub ( super ) fn parse_arm ( & mut self ) -> PResult < ' a , Arm > {
@@ -1697,16 +1697,13 @@ impl<'a> Parser<'a> {
1697
1697
1698
1698
/// Parses an `async move? {...}` expression.
1699
1699
fn parse_async_block ( & mut self , mut attrs : AttrVec ) -> PResult < ' a , P < Expr > > {
1700
- let span_lo = self . token . span ;
1700
+ let lo = self . token . span ;
1701
1701
self . expect_keyword ( kw:: Async ) ?;
1702
1702
let capture_clause = self . parse_capture_clause ( ) ;
1703
1703
let ( iattrs, body) = self . parse_inner_attrs_and_block ( ) ?;
1704
1704
attrs. extend ( iattrs) ;
1705
- Ok ( self . mk_expr (
1706
- span_lo. to ( body. span ) ,
1707
- ExprKind :: Async ( capture_clause, DUMMY_NODE_ID , body) ,
1708
- attrs,
1709
- ) )
1705
+ let kind = ExprKind :: Async ( capture_clause, DUMMY_NODE_ID , body) ;
1706
+ Ok ( self . mk_expr ( lo. to ( self . prev_span ) , kind, attrs) )
1710
1707
}
1711
1708
1712
1709
fn is_async_block ( & self ) -> bool {
0 commit comments