@@ -561,10 +561,10 @@ impl<'a> Parser<'a> {
561
561
token:: Not => make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Not ) ) ,
562
562
// `~expr`
563
563
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
+ }
568
568
// `*expr`
569
569
token:: BinOp ( token:: Star ) => {
570
570
make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Deref ) )
@@ -606,27 +606,7 @@ impl<'a> Parser<'a> {
606
606
let operand_expr = this. parse_dot_or_call_expr ( Default :: default ( ) ) ?;
607
607
this. recover_from_prefix_increment ( operand_expr, pre_span, starts_stmt)
608
608
}
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)
623
609
624
- // }
625
- }
626
- // `-expr`
627
- token:: BinOp ( token:: Minus ) => {
628
- make_it ! ( this, attrs, |this, _| this. parse_unary_expr( lo, UnOp :: Neg ) )
629
- }
630
610
token:: Ident ( ..) if this. token . is_keyword ( kw:: Box ) => {
631
611
make_it ! ( this, attrs, |this, _| this. parse_box_expr( lo) )
632
612
}
0 commit comments