From fa559fb2df28464a12c670c31ddd4068a4e53c88 Mon Sep 17 00:00:00 2001 From: Charles Lew Date: Mon, 26 Apr 2021 01:09:35 +0800 Subject: [PATCH] Implement RFC 1260 with feature_name `imported_main`. --- src/driver/jit.rs | 2 +- src/main_shim.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/jit.rs b/src/driver/jit.rs index dbe1ff083f0..f585ebca9dc 100644 --- a/src/driver/jit.rs +++ b/src/driver/jit.rs @@ -103,7 +103,7 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! { }); let (main_def_id, entry_ty) = tcx.entry_fn(LOCAL_CRATE).unwrap(); - let instance = Instance::mono(tcx, main_def_id.to_def_id()).polymorphize(tcx); + let instance = Instance::mono(tcx, main_def_id).polymorphize(tcx); match entry_ty { EntryFnType::Main => { diff --git a/src/main_shim.rs b/src/main_shim.rs index a6266f50776..dc86290b3fe 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -13,7 +13,7 @@ pub(crate) fn maybe_create_entry_wrapper( ) { let (main_def_id, use_start_lang_item) = match tcx.entry_fn(LOCAL_CRATE) { Some((def_id, entry_ty)) => ( - def_id.to_def_id(), + def_id, match entry_ty { EntryFnType::Main => true, EntryFnType::Start => false,