diff options
| author | bors <bors@rust-lang.org> | 2025-06-05 00:30:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-05 00:30:08 +0000 |
| commit | 81a964c23ea4fe9ab52b4449bb166bf280035797 (patch) | |
| tree | f125374c699b8fed4c7ec8971ae9c2496b772d15 /compiler/rustc_hir_analysis | |
| parent | ff223d35cd684f8c7c07ed4b7fd4475e482359ab (diff) | |
| parent | 4959ee314d220688de394ea7ab3f25f2788ca17b (diff) | |
| download | rust-81a964c23ea4fe9ab52b4449bb166bf280035797.tar.gz rust-81a964c23ea4fe9ab52b4449bb166bf280035797.zip | |
Auto merge of #142033 - matthiaskrgr:rollup-99lvg0j, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - rust-lang/rust#141890 (Add link to correct documentation in htmldocck.py) - rust-lang/rust#141932 (Fix for async drop inside async gen fn) - rust-lang/rust#141960 (Use non-2015 edition paths in tests that do not test for their resolution) - rust-lang/rust#141968 (Run wfcheck in one big loop instead of per module) - rust-lang/rust#141969 (Triagebot: Remove `assign.users_on_vacation`) - rust-lang/rust#141985 (Ensure query keys are printed with reduced queries) - rust-lang/rust#141999 (Visit the ident in `PreciseCapturingNonLifetimeArg`.) - rust-lang/rust#142005 (Change `tag_field` to `FieldIdx` in `Variants::Multiple`) - rust-lang/rust#142017 (Fix incorrect use of "recommend" over "recommended") - rust-lang/rust#142024 (Don't refer to 'this tail expression' in expansion.) - rust-lang/rust#142025 (Don't refer to 'local binding' in extern macro.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir_analysis')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/wfcheck.rs | 13 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/lib.rs | 4 |
2 files changed, 7 insertions, 10 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index b764b714fe1..3e872607e31 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -7,7 +7,7 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; use rustc_errors::codes::*; use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_err}; use rustc_hir::def::{DefKind, Res}; -use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId}; +use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::lang_items::LangItem; use rustc_hir::{AmbigArg, ItemKind}; use rustc_infer::infer::outlives::env::OutlivesEnvironment; @@ -2402,8 +2402,8 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> { } } -fn check_mod_type_wf(tcx: TyCtxt<'_>, module: LocalModDefId) -> Result<(), ErrorGuaranteed> { - let items = tcx.hir_module_items(module); +fn check_type_wf(tcx: TyCtxt<'_>, (): ()) -> Result<(), ErrorGuaranteed> { + let items = tcx.hir_crate_items(()); let res = items .par_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id)) .and(items.par_impl_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id))) @@ -2412,9 +2412,8 @@ fn check_mod_type_wf(tcx: TyCtxt<'_>, module: LocalModDefId) -> Result<(), Error items.par_foreign_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id)), ) .and(items.par_opaques(|item| tcx.ensure_ok().check_well_formed(item))); - if module == LocalModDefId::CRATE_DEF_ID { - super::entry::check_for_entry_fn(tcx); - } + super::entry::check_for_entry_fn(tcx); + res } @@ -2552,5 +2551,5 @@ struct RedundantLifetimeArgsLint<'tcx> { } pub fn provide(providers: &mut Providers) { - *providers = Providers { check_mod_type_wf, check_well_formed, ..*providers }; + *providers = Providers { check_type_wf, check_well_formed, ..*providers }; } diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index a64c24f5455..f255817bffc 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -182,9 +182,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) { // what we are intending to discard, to help future type-based refactoring. type R = Result<(), ErrorGuaranteed>; - tcx.par_hir_for_each_module(|module| { - let _: R = tcx.ensure_ok().check_mod_type_wf(module); - }); + let _: R = tcx.ensure_ok().check_type_wf(()); for &trait_def_id in tcx.all_local_trait_impls(()).keys() { let _: R = tcx.ensure_ok().coherent_trait(trait_def_id); |
