File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
librustc_mir/borrow_check Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -317,9 +317,6 @@ impl<'tcx> NeoPlace<'tcx> {
317
317
tcx : TyCtxt < ' cx , ' gcx , ' tcx > ,
318
318
elem_index : usize ,
319
319
) -> Self {
320
- // only works for place with projections
321
- assert ! ( !self . elems. is_empty( ) ) ;
322
-
323
320
if elem_index < 1 {
324
321
// Base.[a]
325
322
// ^-- elems[0]
@@ -335,6 +332,20 @@ impl<'tcx> NeoPlace<'tcx> {
335
332
}
336
333
}
337
334
335
+ pub fn prefixes < ' cx , ' gcx > (
336
+ & self ,
337
+ tcx : TyCtxt < ' cx , ' gcx , ' tcx > ,
338
+ ) -> Vec < Self > {
339
+ // only works for place with projections
340
+ assert ! ( !self . elems. is_empty( ) ) ;
341
+
342
+ self . elems
343
+ . iter ( )
344
+ . enumerate ( )
345
+ . map ( |( elem_index, _) | self . prefix ( tcx, elem_index) )
346
+ . collect :: < Vec < NeoPlace < ' tcx > > > ( )
347
+ }
348
+
338
349
// Generate types of sub-places
339
350
//
340
351
// Base.[a, b]
Original file line number Diff line number Diff line change @@ -8,13 +8,6 @@ use rustc::mir::visit::{
8
8
} ;
9
9
use rustc:: mir:: { self , Location , Mir , Local } ;
10
10
use rustc:: ty:: { RegionVid , TyCtxt } ;
11
- <<<<<<< HEAD
12
- ||||||| merged common ancestors
13
- use rustc:: mir:: PlaceBase ;
14
- use rustc:: ty:: { RegionVid , TyCtxt } ;
15
- =======
16
- use rustc:: mir:: PlaceBase ;
17
- >>>>>>> generate tys of sub-places
18
11
use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
19
12
use rustc_data_structures:: indexed_vec:: IndexVec ;
20
13
use rustc_data_structures:: bit_set:: BitSet ;
You can’t perform that action at this time.
0 commit comments