diff options
| author | Charles Lew <crlf0710@gmail.com> | 2021-04-26 01:09:35 +0800 |
|---|---|---|
| committer | Charles Lew <crlf0710@gmail.com> | 2021-04-29 08:35:08 +0800 |
| commit | d261df4a72e60e8baa0f21b67eba8f7b91cc2135 (patch) | |
| tree | 4547e05f08c17033fdc8da3d03415010f213d82c /compiler/rustc_codegen_cranelift/src | |
| parent | 727d101561f9b1e81c6282943292d990288ca479 (diff) | |
| download | rust-d261df4a72e60e8baa0f21b67eba8f7b91cc2135.tar.gz rust-d261df4a72e60e8baa0f21b67eba8f7b91cc2135.zip | |
Implement RFC 1260 with feature_name `imported_main`.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/driver/jit.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/main_shim.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/jit.rs b/compiler/rustc_codegen_cranelift/src/driver/jit.rs index dbe1ff083f0..f585ebca9dc 100644 --- a/compiler/rustc_codegen_cranelift/src/driver/jit.rs +++ b/compiler/rustc_codegen_cranelift/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/compiler/rustc_codegen_cranelift/src/main_shim.rs b/compiler/rustc_codegen_cranelift/src/main_shim.rs index a6266f50776..dc86290b3fe 100644 --- a/compiler/rustc_codegen_cranelift/src/main_shim.rs +++ b/compiler/rustc_codegen_cranelift/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, |
