@@ -41,27 +41,25 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
41
41
let expr_span = expr. span ;
42
42
let source_info = this. source_info ( expr_span) ;
43
43
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) ) ,
46
46
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) )
51
49
}
52
50
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) ) ;
54
52
block. and ( Rvalue :: Repeat ( value_operand, count) )
55
53
}
56
54
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)
60
58
}
61
59
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) ) ;
63
61
// 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 ( ) {
65
63
let bool_ty = this. tcx . types . bool ;
66
64
67
65
let minval = this. minval_literal ( expr_span, expr. ty ) ;
@@ -82,7 +80,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
82
80
expr_span,
83
81
) ;
84
82
}
85
- block. and ( Rvalue :: UnaryOp ( * op, arg) )
83
+ block. and ( Rvalue :: UnaryOp ( op, arg) )
86
84
}
87
85
ExprKind :: Box { value } => {
88
86
// The `Box<T>` temporary created here is not a part of the HIR,
@@ -107,18 +105,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
107
105
block = this. expr_into_dest(
108
106
this. tcx. mk_place_deref( Place :: from( result) ) ,
109
107
block,
110
- & value
108
+ value
111
109
)
112
110
) ;
113
111
block. and ( Rvalue :: Use ( Operand :: Move ( Place :: from ( result) ) ) )
114
112
}
115
113
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) ) ;
117
115
block. and ( Rvalue :: Cast ( CastKind :: Misc , source, expr. ty ) )
118
116
}
119
117
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 ) )
122
120
}
123
121
ExprKind :: Array { fields } => {
124
122
// (*) We would (maybe) be closer to codegen if we
@@ -151,7 +149,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
151
149
let el_ty = expr. ty . sequence_element_type ( this. tcx ) ;
152
150
let fields: Vec < _ > = fields
153
151
. into_iter ( )
154
- . map ( |f| unpack ! ( block = this. as_operand( block, scope, & f) ) )
152
+ . map ( |f| unpack ! ( block = this. as_operand( block, scope, f) ) )
155
153
. collect ( ) ;
156
154
157
155
block. and ( Rvalue :: Aggregate ( box AggregateKind :: Array ( el_ty) , fields) )
@@ -161,7 +159,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
161
159
// first process the set of fields
162
160
let fields: Vec < _ > = fields
163
161
. into_iter ( )
164
- . map ( |f| unpack ! ( block = this. as_operand( block, scope, & f) ) )
162
+ . map ( |f| unpack ! ( block = this. as_operand( block, scope, f) ) )
165
163
. collect ( ) ;
166
164
167
165
block. and ( Rvalue :: Aggregate ( box AggregateKind :: Tuple , fields) )
@@ -181,25 +179,25 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
181
179
// This occurs when capturing by copy/move, while
182
180
// by reference captures use as_operand
183
181
Some ( Category :: Place ) => {
184
- let place = unpack ! ( block = this. as_place( block, & upvar) ) ;
182
+ let place = unpack ! ( block = this. as_place( block, upvar) ) ;
185
183
this. consume_by_copy_or_move ( place)
186
184
}
187
185
_ => {
188
186
// Turn mutable borrow captures into unique
189
187
// borrow captures when capturing an immutable
190
188
// variable. This is sound because the mutation
191
189
// that caused the capture will cause an error.
192
- match & upvar. kind {
190
+ match upvar. kind {
193
191
ExprKind :: Borrow {
194
192
borrow_kind :
195
193
BorrowKind :: Mut { allow_two_phase_borrow : false } ,
196
194
arg,
197
195
} => unpack ! (
198
196
block = this. limit_capture_mutability(
199
- upvar. span, upvar. ty, scope, block, & arg,
197
+ upvar. span, upvar. ty, scope, block, arg,
200
198
)
201
199
) ,
202
- _ => unpack ! ( block = this. as_operand( block, scope, & upvar) ) ,
200
+ _ => unpack ! ( block = this. as_operand( block, scope, upvar) ) ,
203
201
}
204
202
}
205
203
}
@@ -210,9 +208,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
210
208
// We implicitly set the discriminant to 0. See
211
209
// librustc_mir/transform/deaggregator.rs for details.
212
210
let movability = movability. unwrap ( ) ;
213
- box AggregateKind :: Generator ( * closure_id, substs, movability)
211
+ box AggregateKind :: Generator ( closure_id, substs, movability)
214
212
}
215
- UpvarSubsts :: Closure ( substs) => box AggregateKind :: Closure ( * closure_id, substs) ,
213
+ UpvarSubsts :: Closure ( substs) => box AggregateKind :: Closure ( closure_id, substs) ,
216
214
} ;
217
215
block. and ( Rvalue :: Aggregate ( result, operands) )
218
216
}
0 commit comments