@@ -159,7 +159,7 @@ pub(crate) fn format_expr(
159159 ast:: ExprKind :: Path ( ref qself, ref path) => {
160160 rewrite_path ( context, PathContext :: Expr , qself. as_ref ( ) , path, shape)
161161 }
162- ast:: ExprKind :: Assign ( ref lhs, ref rhs) => {
162+ ast:: ExprKind :: Assign ( ref lhs, ref rhs, _ ) => {
163163 rewrite_assignment ( context, lhs, rhs, None , shape)
164164 }
165165 ast:: ExprKind :: AssignOp ( ref op, ref lhs, ref rhs) => {
@@ -213,8 +213,8 @@ pub(crate) fn format_expr(
213213 rewrite_unary_prefix ( context, "return " , & * * expr, shape)
214214 }
215215 ast:: ExprKind :: Box ( ref expr) => rewrite_unary_prefix ( context, "box " , & * * expr, shape) ,
216- ast:: ExprKind :: AddrOf ( mutability, ref expr) => {
217- rewrite_expr_addrof ( context, mutability, expr, shape)
216+ ast:: ExprKind :: AddrOf ( borrow_kind , mutability, ref expr) => {
217+ rewrite_expr_addrof ( context, borrow_kind , mutability, expr, shape)
218218 }
219219 ast:: ExprKind :: Cast ( ref expr, ref ty) => rewrite_pair (
220220 & * * expr,
@@ -1289,7 +1289,7 @@ pub(crate) fn is_simple_expr(expr: &ast::Expr) -> bool {
12891289 match expr. kind {
12901290 ast:: ExprKind :: Lit ( ..) => true ,
12911291 ast:: ExprKind :: Path ( ref qself, ref path) => qself. is_none ( ) && path. segments . len ( ) <= 1 ,
1292- ast:: ExprKind :: AddrOf ( _, ref expr)
1292+ ast:: ExprKind :: AddrOf ( _, _ , ref expr)
12931293 | ast:: ExprKind :: Box ( ref expr)
12941294 | ast:: ExprKind :: Cast ( ref expr, _)
12951295 | ast:: ExprKind :: Field ( ref expr, _)
@@ -1347,7 +1347,7 @@ pub(crate) fn can_be_overflowed_expr(
13471347 }
13481348
13491349 // Handle unary-like expressions
1350- ast:: ExprKind :: AddrOf ( _, ref expr)
1350+ ast:: ExprKind :: AddrOf ( _, _ , ref expr)
13511351 | ast:: ExprKind :: Box ( ref expr)
13521352 | ast:: ExprKind :: Try ( ref expr)
13531353 | ast:: ExprKind :: Unary ( _, ref expr)
@@ -1359,7 +1359,7 @@ pub(crate) fn can_be_overflowed_expr(
13591359pub ( crate ) fn is_nested_call ( expr : & ast:: Expr ) -> bool {
13601360 match expr. kind {
13611361 ast:: ExprKind :: Call ( ..) | ast:: ExprKind :: Mac ( ..) => true ,
1362- ast:: ExprKind :: AddrOf ( _, ref expr)
1362+ ast:: ExprKind :: AddrOf ( _, _ , ref expr)
13631363 | ast:: ExprKind :: Box ( ref expr)
13641364 | ast:: ExprKind :: Try ( ref expr)
13651365 | ast:: ExprKind :: Unary ( _, ref expr)
@@ -2035,6 +2035,7 @@ pub(crate) fn prefer_next_line(
20352035
20362036fn rewrite_expr_addrof (
20372037 context : & RewriteContext < ' _ > ,
2038+ _borrow_kind : ast:: BorrowKind ,
20382039 mutability : ast:: Mutability ,
20392040 expr : & ast:: Expr ,
20402041 shape : Shape ,
@@ -2049,7 +2050,7 @@ fn rewrite_expr_addrof(
20492050pub ( crate ) fn is_method_call ( expr : & ast:: Expr ) -> bool {
20502051 match expr. kind {
20512052 ast:: ExprKind :: MethodCall ( ..) => true ,
2052- ast:: ExprKind :: AddrOf ( _, ref expr)
2053+ ast:: ExprKind :: AddrOf ( _, _ , ref expr)
20532054 | ast:: ExprKind :: Box ( ref expr)
20542055 | ast:: ExprKind :: Cast ( ref expr, _)
20552056 | ast:: ExprKind :: Try ( ref expr)
0 commit comments