@@ -284,50 +284,9 @@ impl<'tcx> NeoPlace<'tcx> {
284
284
}
285
285
}
286
286
287
- // for Place:
288
- // (Base.[a, b, c])
289
- // ^^^^^^^^^^ ^-- projection
290
- // |-- base_place
291
- //
292
- // Base.[]
293
- // ^^^^ ^^-- no projection(empty)
294
- // |-- base_place
295
- pub fn split_projection < ' cx , ' gcx > (
296
- & self ,
297
- tcx : TyCtxt < ' cx , ' gcx , ' tcx > ,
298
- ) -> ( NeoPlace < ' tcx > , Option < & ' tcx PlaceElem < ' tcx > > ) {
299
- // split place_elems
300
- // Base.[a, b, c]
301
- // ^^^^ ^-- projection(projection lives in the last elem)
302
- // |-- place_elems
303
- match self . elems . split_last ( ) {
304
- Some ( ( projection, place_elems) ) => (
305
- NeoPlace {
306
- base : self . clone ( ) . base ,
307
- elems : tcx. intern_place_elems ( place_elems) ,
308
- } ,
309
- Some ( projection) ,
310
- ) ,
311
- _ => ( self . clone ( ) , None )
312
- }
313
- }
314
-
315
287
pub fn has_no_projection ( & self ) -> bool {
316
288
self . elems . is_empty ( )
317
289
}
318
-
319
- // for projection returns the base place;
320
- // Base.[a, b, c] => Base.[a, b]
321
- // ^-- projection
322
- // if no projection returns the place itself,
323
- // Base.[] => Base.[]
324
- // ^^-- no projection
325
- pub fn projection_base < ' cx , ' gcx > ( & self , tcx : TyCtxt < ' cx , ' gcx , ' tcx > ) -> NeoPlace < ' tcx > {
326
- match self . split_projection ( tcx) {
327
- ( place, Some ( _) ) => place,
328
- ( _, None ) => self . clone ( ) ,
329
- }
330
- }
331
290
}
332
291
333
292
pub enum RvalueInitializationState {
0 commit comments