@@ -266,10 +266,7 @@ impl<'a, 'tcx: 'a> CrateContextList<'a, 'tcx> {
266
266
/// pass around (SharedCrateContext, LocalCrateContext) tuples all over trans.
267
267
pub struct CrateContext < ' a , ' tcx : ' a > {
268
268
shared : & ' a SharedCrateContext < ' a , ' tcx > ,
269
- local_ccxs : & ' a [ LocalCrateContext < ' tcx > ] ,
270
- /// The index of `local` in `local_ccxs`. This is used in
271
- /// `maybe_iter(true)` to identify the original `LocalCrateContext`.
272
- index : usize ,
269
+ local_ccx : & ' a LocalCrateContext < ' tcx > ,
273
270
}
274
271
275
272
impl < ' a , ' tcx > DepGraphSafe for CrateContext < ' a , ' tcx > {
@@ -298,8 +295,7 @@ impl<'a, 'tcx> Iterator for CrateContextIterator<'a,'tcx> {
298
295
299
296
let ccx = CrateContext {
300
297
shared : self . shared ,
301
- index : index,
302
- local_ccxs : self . local_ccxs ,
298
+ local_ccx : & self . local_ccxs [ index] ,
303
299
} ;
304
300
305
301
if
@@ -630,8 +626,7 @@ impl<'tcx> LocalCrateContext<'tcx> {
630
626
assert ! ( local_ccxs. len( ) == 1 ) ;
631
627
CrateContext {
632
628
shared : shared,
633
- index : 0 ,
634
- local_ccxs : local_ccxs
629
+ local_ccx : & local_ccxs[ 0 ]
635
630
}
636
631
}
637
632
}
@@ -642,7 +637,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
642
637
}
643
638
644
639
fn local ( & self ) -> & ' b LocalCrateContext < ' tcx > {
645
- & self . local_ccxs [ self . index ]
640
+ self . local_ccx
646
641
}
647
642
648
643
pub fn tcx < ' a > ( & ' a self ) -> TyCtxt < ' a , ' tcx , ' tcx > {
0 commit comments