about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCharles Lew <crlf0710@gmail.com>2021-04-26 01:09:35 +0800
committerCharles Lew <crlf0710@gmail.com>2021-04-29 08:35:08 +0800
commitfa559fb2df28464a12c670c31ddd4068a4e53c88 (patch)
tree50d49f0715a820a96c2e0fc70b2660e673ffa128
parentea3398ad9856acfc3ac93991389de92597f42884 (diff)
downloadrust-fa559fb2df28464a12c670c31ddd4068a4e53c88.tar.gz
rust-fa559fb2df28464a12c670c31ddd4068a4e53c88.zip
Implement RFC 1260 with feature_name `imported_main`.
-rw-r--r--src/driver/jit.rs2
-rw-r--r--src/main_shim.rs2
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,