Skip to content

Commit 55c5ab9

Browse files
committed
Inline and remove item_requires_monomorphization.
It's very simple and has a single call site.
1 parent 42c8803 commit 55c5ab9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

compiler/rustc_monomorphize/src/collector.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ use rustc_hir::lang_items::LangItem;
173173
use rustc_middle::mir::interpret::{AllocId, ErrorHandled, GlobalAlloc, Scalar};
174174
use rustc_middle::mir::mono::{InstantiationMode, MonoItem};
175175
use rustc_middle::mir::visit::Visitor as MirVisitor;
176-
use rustc_middle::mir::{self, Local, Location};
176+
use rustc_middle::mir::{self, Location};
177177
use rustc_middle::query::TyCtxtAt;
178178
use rustc_middle::ty::adjustment::{CustomCoerceUnsized, PointerCoercion};
179179
use 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))]
12841279
fn create_mono_items_for_default_impls<'tcx>(
12851280
tcx: TyCtxt<'tcx>,

0 commit comments

Comments
 (0)