about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2025-07-17 18:41:52 -0400
committerBen Kimock <kimockb@gmail.com>2025-07-21 19:54:37 -0400
commitc4eb07761643d2fa26d6f609eb23c8d22e14d8eb (patch)
treeb1e562d8d3a6158abb3a9a7234ef860c74e949fa /compiler/rustc_middle/src/mir
parent9cd918bcbbc26deb005eb4e1bd9a445380195e56 (diff)
Ensure we codegen and don't internalize the entrypoint
Diffstat (limited to 'compiler/rustc_middle/src/mir')
-rw-r--r--compiler/rustc_middle/src/mir/mono.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs
index 47ba850d50d..c2927361d05 100644
--- a/compiler/rustc_middle/src/mir/mono.rs
+++ b/compiler/rustc_middle/src/mir/mono.rs
@@ -143,10 +143,8 @@ impl<'tcx> MonoItem<'tcx> {
         };
 
         // Similarly, the executable entrypoint must be instantiated exactly once.
-        if let Some((entry_def_id, _)) = tcx.entry_fn(()) {
-            if instance.def_id() == entry_def_id {
-                return InstantiationMode::GloballyShared { may_conflict: false };
-            }
+        if tcx.is_entrypoint(instance.def_id()) {
+            return InstantiationMode::GloballyShared { may_conflict: false };
         }
 
         // If the function is #[naked] or contains any other attribute that requires exactly-once