Implement RFC 1260 with feature_name imported_main.

This commit is contained in:
Charles Lew 2021-04-26 01:09:35 +08:00
parent ea3398ad98
commit fa559fb2df
2 changed files with 2 additions and 2 deletions

View File

@ -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 => {

View File

@ -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,