@@ -1271,18 +1271,18 @@ impl<'a> State<'a> {
1271
1271
self . print_call_post ( base_args)
1272
1272
}
1273
1273
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 ( ) ;
1276
1276
let left_prec = lhs. precedence ( ) ;
1277
1277
let right_prec = rhs. precedence ( ) ;
1278
1278
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 ( ) {
1280
1280
Fixity :: Left => ( left_prec < binop_prec, right_prec <= binop_prec) ,
1281
1281
Fixity :: Right => ( left_prec <= binop_prec, right_prec < binop_prec) ,
1282
1282
Fixity :: None => ( left_prec <= binop_prec, right_prec <= binop_prec) ,
1283
1283
} ;
1284
1284
1285
- match ( & lhs. kind , op. node ) {
1285
+ match ( & lhs. kind , op) {
1286
1286
// These cases need parens: `x as i32 < y` has the parser thinking that `i32 < y` is
1287
1287
// the beginning of a path type. It starts trying to parse `x as (i32 < y ...` instead
1288
1288
// of `(x as i32) < ...`. We need to convince it _not_ to do that.
@@ -1297,7 +1297,7 @@ impl<'a> State<'a> {
1297
1297
1298
1298
self . print_expr_cond_paren ( lhs, left_needs_paren) ;
1299
1299
self . space ( ) ;
1300
- self . word_space ( op. node . as_str ( ) ) ;
1300
+ self . word_space ( op. as_str ( ) ) ;
1301
1301
self . print_expr_cond_paren ( rhs, right_needs_paren) ;
1302
1302
}
1303
1303
@@ -1451,7 +1451,7 @@ impl<'a> State<'a> {
1451
1451
self . word ( ".use" ) ;
1452
1452
}
1453
1453
hir:: ExprKind :: Binary ( op, lhs, rhs) => {
1454
- self . print_expr_binary ( op, lhs, rhs) ;
1454
+ self . print_expr_binary ( op. node , lhs, rhs) ;
1455
1455
}
1456
1456
hir:: ExprKind :: Unary ( op, expr) => {
1457
1457
self . print_expr_unary ( op, expr) ;
@@ -1572,8 +1572,7 @@ impl<'a> State<'a> {
1572
1572
hir:: ExprKind :: AssignOp ( op, lhs, rhs) => {
1573
1573
self . print_expr_cond_paren ( lhs, lhs. precedence ( ) <= ExprPrecedence :: Assign ) ;
1574
1574
self . space ( ) ;
1575
- self . word ( op. node . as_str ( ) ) ;
1576
- self . word_space ( "=" ) ;
1575
+ self . word_space ( op. node . as_str ( ) ) ;
1577
1576
self . print_expr_cond_paren ( rhs, rhs. precedence ( ) < ExprPrecedence :: Assign ) ;
1578
1577
}
1579
1578
hir:: ExprKind :: Field ( expr, ident) => {
0 commit comments