Merge check_for_entry_fn fully into check_mod_type_wf

This commit is contained in:
Oli Scherer
2023-10-30 15:12:45 +00:00
parent cd4c352fb4
commit 5b13dc71cd
5 changed files with 8 additions and 15 deletions

View File

@@ -14,7 +14,7 @@ use std::ops::Not;
use super::check_function_signature;
use crate::errors;
pub(crate) fn check_for_entry_fn(tcx: TyCtxt<'_>, (): ()) {
pub(crate) fn check_for_entry_fn(tcx: TyCtxt<'_>) {
match tcx.entry_fn(()) {
Some((def_id, EntryFnType::Main { .. })) => check_main_fn_ty(tcx, def_id),
Some((def_id, EntryFnType::Start)) => check_start_fn_ty(tcx, def_id),

View File

@@ -75,7 +75,6 @@ pub use check::check_abi;
use std::num::NonZeroU32;
use entry::check_for_entry_fn;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::ErrorGuaranteed;
use rustc_errors::{pluralize, struct_span_err, Diagnostic, DiagnosticBuilder};
@@ -110,7 +109,6 @@ pub fn provide(providers: &mut Providers) {
wfcheck::provide(providers);
*providers = Providers {
adt_destructor,
check_for_entry_fn,
region_scope_tree,
collect_return_position_impl_trait_in_trait_tys,
compare_impl_const: compare_impl_item::compare_impl_const_raw,

View File

@@ -1913,7 +1913,11 @@ fn check_mod_type_wf(tcx: TyCtxt<'_>, module: LocalModDefId) -> Result<(), Error
let mut res = items.par_items(|item| tcx.ensure().check_well_formed(item.owner_id));
res = res.and(items.par_impl_items(|item| tcx.ensure().check_well_formed(item.owner_id)));
res = res.and(items.par_trait_items(|item| tcx.ensure().check_well_formed(item.owner_id)));
res.and(items.par_foreign_items(|item| tcx.ensure().check_well_formed(item.owner_id)))
res = res.and(items.par_foreign_items(|item| tcx.ensure().check_well_formed(item.owner_id)));
if module == LocalModDefId::CRATE_DEF_ID {
super::entry::check_for_entry_fn(tcx);
}
res
}
fn error_392(tcx: TyCtxt<'_>, span: Span, param_name: Symbol) -> DiagnosticBuilder<'_> {