@@ -185,9 +185,9 @@ trait Qualif {
185
185
base : & PlaceBase < ' tcx > ,
186
186
proj : & Projection < ' tcx > ,
187
187
) -> bool {
188
- let base_qualif = Self :: in_place ( cx, & Place {
189
- base : base . clone ( ) ,
190
- projection : proj. base . clone ( ) ,
188
+ let base_qualif = Self :: in_place ( cx, PlaceRef {
189
+ base,
190
+ projection : & proj. base ,
191
191
} ) ;
192
192
let qualif = base_qualif && Self :: mask_for_ty (
193
193
cx,
@@ -214,36 +214,36 @@ trait Qualif {
214
214
Self :: in_projection_structurally ( cx, base, proj)
215
215
}
216
216
217
- fn in_place ( cx : & ConstCx < ' _ , ' tcx > , place : & Place < ' tcx > ) -> bool {
218
- match * place {
219
- Place {
217
+ fn in_place ( cx : & ConstCx < ' _ , ' tcx > , place : PlaceRef < ' _ , ' tcx > ) -> bool {
218
+ match place {
219
+ PlaceRef {
220
220
base : PlaceBase :: Local ( local) ,
221
221
projection : None ,
222
- } => Self :: in_local ( cx, local) ,
223
- Place {
222
+ } => Self :: in_local ( cx, * local) ,
223
+ PlaceRef {
224
224
base : PlaceBase :: Static ( box Static {
225
225
kind : StaticKind :: Promoted ( _) ,
226
226
..
227
227
} ) ,
228
228
projection : None ,
229
229
} => bug ! ( "qualifying already promoted MIR" ) ,
230
- Place {
231
- base : PlaceBase :: Static ( ref static_) ,
230
+ PlaceRef {
231
+ base : PlaceBase :: Static ( static_) ,
232
232
projection : None ,
233
233
} => {
234
234
Self :: in_static ( cx, static_)
235
235
} ,
236
- Place {
237
- ref base,
238
- projection : Some ( ref proj) ,
239
- } => Self :: in_projection ( cx, & base, proj) ,
236
+ PlaceRef {
237
+ base,
238
+ projection : Some ( proj) ,
239
+ } => Self :: in_projection ( cx, base, proj) ,
240
240
}
241
241
}
242
242
243
243
fn in_operand ( cx : & ConstCx < ' _ , ' tcx > , operand : & Operand < ' tcx > ) -> bool {
244
244
match * operand {
245
245
Operand :: Copy ( ref place) |
246
- Operand :: Move ( ref place) => Self :: in_place ( cx, place) ,
246
+ Operand :: Move ( ref place) => Self :: in_place ( cx, place. as_place_ref ( ) ) ,
247
247
248
248
Operand :: Constant ( ref constant) => {
249
249
if let ConstValue :: Unevaluated ( def_id, _) = constant. literal . val {
@@ -272,7 +272,7 @@ trait Qualif {
272
272
Rvalue :: NullaryOp ( ..) => false ,
273
273
274
274
Rvalue :: Discriminant ( ref place) |
275
- Rvalue :: Len ( ref place) => Self :: in_place ( cx, place) ,
275
+ Rvalue :: Len ( ref place) => Self :: in_place ( cx, place. as_place_ref ( ) ) ,
276
276
277
277
Rvalue :: Use ( ref operand) |
278
278
Rvalue :: Repeat ( ref operand, _) |
@@ -290,15 +290,15 @@ trait Qualif {
290
290
if let ProjectionElem :: Deref = proj. elem {
291
291
let base_ty = Place :: ty_from ( & place. base , & proj. base , cx. body , cx. tcx ) . ty ;
292
292
if let ty:: Ref ( ..) = base_ty. sty {
293
- return Self :: in_place ( cx, & Place {
294
- base : place. base . clone ( ) ,
295
- projection : proj. base . clone ( ) ,
293
+ return Self :: in_place ( cx, PlaceRef {
294
+ base : & place. base ,
295
+ projection : & proj. base ,
296
296
} ) ;
297
297
}
298
298
}
299
299
}
300
300
301
- Self :: in_place ( cx, place)
301
+ Self :: in_place ( cx, place. as_place_ref ( ) )
302
302
}
303
303
304
304
Rvalue :: Aggregate ( _, ref operands) => {
0 commit comments