@@ -173,7 +173,7 @@ use rustc_hir::lang_items::LangItem;
173173use rustc_middle:: mir:: interpret:: { AllocId , ErrorHandled , GlobalAlloc , Scalar } ;
174174use rustc_middle:: mir:: mono:: { InstantiationMode , MonoItem } ;
175175use rustc_middle:: mir:: visit:: Visitor as MirVisitor ;
176- use rustc_middle:: mir:: { self , Local , Location } ;
176+ use rustc_middle:: mir:: { self , Location } ;
177177use rustc_middle:: query:: TyCtxtAt ;
178178use rustc_middle:: ty:: adjustment:: { CustomCoerceUnsized , PointerCoercion } ;
179179use rustc_middle:: ty:: print:: with_no_trimmed_paths;
@@ -1212,7 +1212,7 @@ impl<'v> RootCollector<'_, 'v> {
12121212 }
12131213
12141214 fn is_root ( & self , def_id : LocalDefId ) -> bool {
1215- !item_requires_monomorphization ( self . tcx , def_id)
1215+ !self . tcx . generics_of ( def_id) . requires_monomorphization ( self . tcx )
12161216 && match self . mode {
12171217 MonoItemCollectionMode :: Eager => true ,
12181218 MonoItemCollectionMode :: Lazy => {
@@ -1275,11 +1275,6 @@ impl<'v> RootCollector<'_, 'v> {
12751275 }
12761276}
12771277
1278- fn item_requires_monomorphization ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) -> bool {
1279- let generics = tcx. generics_of ( def_id) ;
1280- generics. requires_monomorphization ( tcx)
1281- }
1282-
12831278#[ instrument( level = "debug" , skip( tcx, output) ) ]
12841279fn create_mono_items_for_default_impls < ' tcx > (
12851280 tcx : TyCtxt < ' tcx > ,
0 commit comments