@@ -41,27 +41,25 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
4141 let expr_span = expr. span ;
4242 let source_info = this. source_info ( expr_span) ;
4343
44- match & expr. kind {
45- ExprKind :: ThreadLocalRef ( did) => block. and ( Rvalue :: ThreadLocalRef ( * did) ) ,
44+ match expr. kind {
45+ ExprKind :: ThreadLocalRef ( did) => block. and ( Rvalue :: ThreadLocalRef ( did) ) ,
4646 ExprKind :: Scope { region_scope, lint_level, value } => {
47- let region_scope = ( * region_scope, source_info) ;
48- this. in_scope ( region_scope, * lint_level, |this| {
49- this. as_rvalue ( block, scope, & value)
50- } )
47+ let region_scope = ( region_scope, source_info) ;
48+ this. in_scope ( region_scope, lint_level, |this| this. as_rvalue ( block, scope, value) )
5149 }
5250 ExprKind :: Repeat { value, count } => {
53- let value_operand = unpack ! ( block = this. as_operand( block, scope, & value) ) ;
51+ let value_operand = unpack ! ( block = this. as_operand( block, scope, value) ) ;
5452 block. and ( Rvalue :: Repeat ( value_operand, count) )
5553 }
5654 ExprKind :: Binary { op, lhs, rhs } => {
57- let lhs = unpack ! ( block = this. as_operand( block, scope, & lhs) ) ;
58- let rhs = unpack ! ( block = this. as_operand( block, scope, & rhs) ) ;
59- this. build_binary_op ( block, * op, expr_span, expr. ty , lhs, rhs)
55+ let lhs = unpack ! ( block = this. as_operand( block, scope, lhs) ) ;
56+ let rhs = unpack ! ( block = this. as_operand( block, scope, rhs) ) ;
57+ this. build_binary_op ( block, op, expr_span, expr. ty , lhs, rhs)
6058 }
6159 ExprKind :: Unary { op, arg } => {
62- let arg = unpack ! ( block = this. as_operand( block, scope, & arg) ) ;
60+ let arg = unpack ! ( block = this. as_operand( block, scope, arg) ) ;
6361 // Check for -MIN on signed integers
64- if this. check_overflow && * op == UnOp :: Neg && expr. ty . is_signed ( ) {
62+ if this. check_overflow && op == UnOp :: Neg && expr. ty . is_signed ( ) {
6563 let bool_ty = this. tcx . types . bool ;
6664
6765 let minval = this. minval_literal ( expr_span, expr. ty ) ;
@@ -82,7 +80,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
8280 expr_span,
8381 ) ;
8482 }
85- block. and ( Rvalue :: UnaryOp ( * op, arg) )
83+ block. and ( Rvalue :: UnaryOp ( op, arg) )
8684 }
8785 ExprKind :: Box { value } => {
8886 // The `Box<T>` temporary created here is not a part of the HIR,
@@ -107,18 +105,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
107105 block = this. expr_into_dest(
108106 this. tcx. mk_place_deref( Place :: from( result) ) ,
109107 block,
110- & value
108+ value
111109 )
112110 ) ;
113111 block. and ( Rvalue :: Use ( Operand :: Move ( Place :: from ( result) ) ) )
114112 }
115113 ExprKind :: Cast { source } => {
116- let source = unpack ! ( block = this. as_operand( block, scope, & source) ) ;
114+ let source = unpack ! ( block = this. as_operand( block, scope, source) ) ;
117115 block. and ( Rvalue :: Cast ( CastKind :: Misc , source, expr. ty ) )
118116 }
119117 ExprKind :: Pointer { cast, source } => {
120- let source = unpack ! ( block = this. as_operand( block, scope, & source) ) ;
121- block. and ( Rvalue :: Cast ( CastKind :: Pointer ( * cast) , source, expr. ty ) )
118+ let source = unpack ! ( block = this. as_operand( block, scope, source) ) ;
119+ block. and ( Rvalue :: Cast ( CastKind :: Pointer ( cast) , source, expr. ty ) )
122120 }
123121 ExprKind :: Array { fields } => {
124122 // (*) We would (maybe) be closer to codegen if we
@@ -151,7 +149,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
151149 let el_ty = expr. ty . sequence_element_type ( this. tcx ) ;
152150 let fields: Vec < _ > = fields
153151 . into_iter ( )
154- . map ( |f| unpack ! ( block = this. as_operand( block, scope, & f) ) )
152+ . map ( |f| unpack ! ( block = this. as_operand( block, scope, f) ) )
155153 . collect ( ) ;
156154
157155 block. and ( Rvalue :: Aggregate ( box AggregateKind :: Array ( el_ty) , fields) )
@@ -161,7 +159,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
161159 // first process the set of fields
162160 let fields: Vec < _ > = fields
163161 . into_iter ( )
164- . map ( |f| unpack ! ( block = this. as_operand( block, scope, & f) ) )
162+ . map ( |f| unpack ! ( block = this. as_operand( block, scope, f) ) )
165163 . collect ( ) ;
166164
167165 block. and ( Rvalue :: Aggregate ( box AggregateKind :: Tuple , fields) )
@@ -181,25 +179,25 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
181179 // This occurs when capturing by copy/move, while
182180 // by reference captures use as_operand
183181 Some ( Category :: Place ) => {
184- let place = unpack ! ( block = this. as_place( block, & upvar) ) ;
182+ let place = unpack ! ( block = this. as_place( block, upvar) ) ;
185183 this. consume_by_copy_or_move ( place)
186184 }
187185 _ => {
188186 // Turn mutable borrow captures into unique
189187 // borrow captures when capturing an immutable
190188 // variable. This is sound because the mutation
191189 // that caused the capture will cause an error.
192- match & upvar. kind {
190+ match upvar. kind {
193191 ExprKind :: Borrow {
194192 borrow_kind :
195193 BorrowKind :: Mut { allow_two_phase_borrow : false } ,
196194 arg,
197195 } => unpack ! (
198196 block = this. limit_capture_mutability(
199- upvar. span, upvar. ty, scope, block, & arg,
197+ upvar. span, upvar. ty, scope, block, arg,
200198 )
201199 ) ,
202- _ => unpack ! ( block = this. as_operand( block, scope, & upvar) ) ,
200+ _ => unpack ! ( block = this. as_operand( block, scope, upvar) ) ,
203201 }
204202 }
205203 }
@@ -210,9 +208,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
210208 // We implicitly set the discriminant to 0. See
211209 // librustc_mir/transform/deaggregator.rs for details.
212210 let movability = movability. unwrap ( ) ;
213- box AggregateKind :: Generator ( * closure_id, substs, movability)
211+ box AggregateKind :: Generator ( closure_id, substs, movability)
214212 }
215- UpvarSubsts :: Closure ( substs) => box AggregateKind :: Closure ( * closure_id, substs) ,
213+ UpvarSubsts :: Closure ( substs) => box AggregateKind :: Closure ( closure_id, substs) ,
216214 } ;
217215 block. and ( Rvalue :: Aggregate ( result, operands) )
218216 }
0 commit comments