@@ -561,10 +561,10 @@ impl<'a> Parser<'a> {
561561 token:: Not => make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Not ) ) ,
562562 // `~expr`
563563 token:: Tilde => make_it ! ( this, attrs, |this, _| this. recover_tilde_expr( lo) ) ,
564- // // `-expr`
565- // token::BinOp(token::Minus) => {
566- // make_it!(this, attrs, |this, _| this.parse_unary_expr(lo, UnOp::Neg))
567- // }
564+ // `-expr`
565+ token:: BinOp ( token:: Minus ) => {
566+ make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Neg ) )
567+ }
568568 // `*expr`
569569 token:: BinOp ( token:: Star ) => {
570570 make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Deref ) )
@@ -606,27 +606,7 @@ impl<'a> Parser<'a> {
606606 let operand_expr = this. parse_dot_or_call_expr ( Default :: default ( ) ) ?;
607607 this. recover_from_prefix_increment ( operand_expr, pre_span, starts_stmt)
608608 }
609- // Recover from `--x`:
610- token:: BinOp ( token:: Minus )
611- if this. look_ahead ( 1 , |t| * t == token:: BinOp ( token:: Minus ) )
612- && !this. token . can_begin_expr ( ) =>
613- {
614- let starts_stmt = this. prev_token == token:: Semi
615- || this. prev_token == token:: CloseDelim ( Delimiter :: Brace ) ;
616- let pre_span = this. token . span . to ( this. look_ahead ( 1 , |t| t. span ) ) ;
617- // if !this.token.can_begin_expr() {
618- // Eat both `-`s.
619- this. bump ( ) ;
620- this. bump ( ) ;
621- let operand_expr = this. parse_dot_or_call_expr ( Default :: default ( ) ) ?;
622- this. recover_from_prefix_decrement ( operand_expr, pre_span, starts_stmt)
623609
624- // }
625- }
626- // `-expr`
627- token:: BinOp ( token:: Minus ) => {
628- make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Neg ) )
629- }
630610 token:: Ident ( ..) if this. token . is_keyword ( kw:: Box ) => {
631611 make_it ! ( this, attrs, |this, _| this. parse_box_expr( lo) )
632612 }
0 commit comments