@@ -1271,18 +1271,18 @@ impl<'a> State<'a> {
12711271 self . print_call_post ( base_args)
12721272 }
12731273
1274- fn print_expr_binary ( & mut self , op : hir:: BinOp , lhs : & hir:: Expr < ' _ > , rhs : & hir:: Expr < ' _ > ) {
1275- let binop_prec = op. node . precedence ( ) ;
1274+ fn print_expr_binary ( & mut self , op : hir:: BinOpKind , lhs : & hir:: Expr < ' _ > , rhs : & hir:: Expr < ' _ > ) {
1275+ let binop_prec = op. precedence ( ) ;
12761276 let left_prec = lhs. precedence ( ) ;
12771277 let right_prec = rhs. precedence ( ) ;
12781278
1279- let ( mut left_needs_paren, right_needs_paren) = match op. node . fixity ( ) {
1279+ let ( mut left_needs_paren, right_needs_paren) = match op. fixity ( ) {
12801280 Fixity :: Left => ( left_prec < binop_prec, right_prec <= binop_prec) ,
12811281 Fixity :: Right => ( left_prec <= binop_prec, right_prec < binop_prec) ,
12821282 Fixity :: None => ( left_prec <= binop_prec, right_prec <= binop_prec) ,
12831283 } ;
12841284
1285- match ( & lhs. kind , op. node ) {
1285+ match ( & lhs. kind , op) {
12861286 // These cases need parens: `x as i32 < y` has the parser thinking that `i32 < y` is
12871287 // the beginning of a path type. It starts trying to parse `x as (i32 < y ...` instead
12881288 // of `(x as i32) < ...`. We need to convince it _not_ to do that.
@@ -1297,7 +1297,7 @@ impl<'a> State<'a> {
12971297
12981298 self . print_expr_cond_paren ( lhs, left_needs_paren) ;
12991299 self . space ( ) ;
1300- self . word_space ( op. node . as_str ( ) ) ;
1300+ self . word_space ( op. as_str ( ) ) ;
13011301 self . print_expr_cond_paren ( rhs, right_needs_paren) ;
13021302 }
13031303
@@ -1451,7 +1451,7 @@ impl<'a> State<'a> {
14511451 self . word ( ".use" ) ;
14521452 }
14531453 hir:: ExprKind :: Binary ( op, lhs, rhs) => {
1454- self . print_expr_binary ( op, lhs, rhs) ;
1454+ self . print_expr_binary ( op. node , lhs, rhs) ;
14551455 }
14561456 hir:: ExprKind :: Unary ( op, expr) => {
14571457 self . print_expr_unary ( op, expr) ;
@@ -1572,8 +1572,7 @@ impl<'a> State<'a> {
15721572 hir:: ExprKind :: AssignOp ( op, lhs, rhs) => {
15731573 self . print_expr_cond_paren ( lhs, lhs. precedence ( ) <= ExprPrecedence :: Assign ) ;
15741574 self . space ( ) ;
1575- self . word ( op. node . as_str ( ) ) ;
1576- self . word_space ( "=" ) ;
1575+ self . word_space ( op. node . as_str ( ) ) ;
15771576 self . print_expr_cond_paren ( rhs, rhs. precedence ( ) < ExprPrecedence :: Assign ) ;
15781577 }
15791578 hir:: ExprKind :: Field ( expr, ident) => {
0 commit comments