@@ -214,7 +214,7 @@ use rustc_data_structures::bitvec::BitVector;
214
214
use syntax:: attr;
215
215
216
216
#[ derive( PartialEq , Eq , Hash , Clone , Copy , Debug ) ]
217
- pub enum TransItemCollectionMode {
217
+ pub enum MonoItemCollectionMode {
218
218
Eager ,
219
219
Lazy
220
220
}
@@ -296,7 +296,7 @@ impl<'tcx> InliningMap<'tcx> {
296
296
}
297
297
298
298
pub fn collect_crate_translation_items < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
299
- mode : TransItemCollectionMode )
299
+ mode : MonoItemCollectionMode )
300
300
-> ( FxHashSet < MonoItem < ' tcx > > ,
301
301
InliningMap < ' tcx > ) {
302
302
let roots = collect_roots ( tcx, mode) ;
@@ -320,7 +320,7 @@ pub fn collect_crate_translation_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
320
320
// Find all non-generic items by walking the HIR. These items serve as roots to
321
321
// start monomorphizing from.
322
322
fn collect_roots < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
323
- mode : TransItemCollectionMode )
323
+ mode : MonoItemCollectionMode )
324
324
-> Vec < MonoItem < ' tcx > > {
325
325
debug ! ( "Collecting roots" ) ;
326
326
let mut roots = Vec :: new ( ) ;
@@ -880,7 +880,7 @@ fn create_trans_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
880
880
881
881
struct RootCollector < ' b , ' a : ' b , ' tcx : ' a + ' b > {
882
882
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
883
- mode : TransItemCollectionMode ,
883
+ mode : MonoItemCollectionMode ,
884
884
output : & ' b mut Vec < MonoItem < ' tcx > > ,
885
885
entry_fn : Option < DefId > ,
886
886
}
@@ -900,7 +900,7 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {
900
900
}
901
901
902
902
hir:: ItemImpl ( ..) => {
903
- if self . mode == TransItemCollectionMode :: Eager {
903
+ if self . mode == MonoItemCollectionMode :: Eager {
904
904
create_trans_items_for_default_impls ( self . tcx ,
905
905
item,
906
906
self . output ) ;
@@ -911,7 +911,7 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {
911
911
hir:: ItemStruct ( _, ref generics) |
912
912
hir:: ItemUnion ( _, ref generics) => {
913
913
if !generics. is_parameterized ( ) {
914
- if self . mode == TransItemCollectionMode :: Eager {
914
+ if self . mode == MonoItemCollectionMode :: Eager {
915
915
let def_id = self . tcx . hir . local_def_id ( item. id ) ;
916
916
debug ! ( "RootCollector: ADT drop-glue for {}" ,
917
917
def_id_to_string( self . tcx, def_id) ) ;
@@ -979,10 +979,10 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {
979
979
impl < ' b , ' a , ' v > RootCollector < ' b , ' a , ' v > {
980
980
fn is_root ( & self , def_id : DefId ) -> bool {
981
981
!item_has_type_parameters ( self . tcx , def_id) && match self . mode {
982
- TransItemCollectionMode :: Eager => {
982
+ MonoItemCollectionMode :: Eager => {
983
983
true
984
984
}
985
- TransItemCollectionMode :: Lazy => {
985
+ MonoItemCollectionMode :: Lazy => {
986
986
self . entry_fn == Some ( def_id) ||
987
987
self . tcx . is_exported_symbol ( def_id) ||
988
988
attr:: contains_name ( & self . tcx . get_attrs ( def_id) ,
0 commit comments