@@ -173,7 +173,7 @@ use rustc_hir::lang_items::LangItem;
173
173
use rustc_middle:: mir:: interpret:: { AllocId , ErrorHandled , GlobalAlloc , Scalar } ;
174
174
use rustc_middle:: mir:: mono:: { InstantiationMode , MonoItem } ;
175
175
use rustc_middle:: mir:: visit:: Visitor as MirVisitor ;
176
- use rustc_middle:: mir:: { self , Local , Location } ;
176
+ use rustc_middle:: mir:: { self , Location } ;
177
177
use rustc_middle:: query:: TyCtxtAt ;
178
178
use rustc_middle:: ty:: adjustment:: { CustomCoerceUnsized , PointerCoercion } ;
179
179
use rustc_middle:: ty:: print:: with_no_trimmed_paths;
@@ -1212,7 +1212,7 @@ impl<'v> RootCollector<'_, 'v> {
1212
1212
}
1213
1213
1214
1214
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 )
1216
1216
&& match self . mode {
1217
1217
MonoItemCollectionMode :: Eager => true ,
1218
1218
MonoItemCollectionMode :: Lazy => {
@@ -1275,11 +1275,6 @@ impl<'v> RootCollector<'_, 'v> {
1275
1275
}
1276
1276
}
1277
1277
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
-
1283
1278
#[ instrument( level = "debug" , skip( tcx, output) ) ]
1284
1279
fn create_mono_items_for_default_impls < ' tcx > (
1285
1280
tcx : TyCtxt < ' tcx > ,
0 commit comments