]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/monomorphize/collector.rs
Rollup merge of #84655 - CDirkx:wasm, r=m-ou-se
[rust.git] / compiler / rustc_mir / src / monomorphize / collector.rs
index e621bc9167d801dc3c4f2587e0ac714e8684a741..fdefc890674774ad21dae37304e2e6557334323d 100644 (file)
@@ -1066,7 +1066,7 @@ struct RootCollector<'a, 'tcx> {
     tcx: TyCtxt<'tcx>,
     mode: MonoItemCollectionMode,
     output: &'a mut Vec<Spanned<MonoItem<'tcx>>>,
-    entry_fn: Option<(LocalDefId, EntryFnType)>,
+    entry_fn: Option<(DefId, EntryFnType)>,
 }
 
 impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> {
@@ -1154,7 +1154,7 @@ fn is_root(&self, def_id: LocalDefId) -> bool {
             && match self.mode {
                 MonoItemCollectionMode::Eager => true,
                 MonoItemCollectionMode::Lazy => {
-                    self.entry_fn.map(|(id, _)| id) == Some(def_id)
+                    self.entry_fn.and_then(|(id, _)| id.as_local()) == Some(def_id)
                         || self.tcx.is_reachable_non_generic(def_id)
                         || self
                             .tcx