Skip to content

Commit 237ba6f

Browse files
authored
Rollup merge of rust-lang#48939 - wesleywiser:incr_query_wf_checking, r=michaelwoerister
Querify WF-checking so it can be cached r? @michaelwoerister
2 parents 0a75a74 + b418b7b commit 237ba6f

File tree

5 files changed

+545
-506
lines changed

5 files changed

+545
-506
lines changed

Diff for: src/librustc/dep_graph/dep_node.rs

+3
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,9 @@ define_dep_nodes!( <'tcx>
579579
[] GetPanicStrategy(CrateNum),
580580
[] IsNoBuiltins(CrateNum),
581581
[] ImplDefaultness(DefId),
582+
[] CheckItemWellFormed(DefId),
583+
[] CheckTraitItemWellFormed(DefId),
584+
[] CheckImplItemWellFormed(DefId),
582585
[] ReachableNonGenerics(CrateNum),
583586
[] NativeLibraries(CrateNum),
584587
[] PluginRegistrarFn(CrateNum),

Diff for: src/librustc/ty/maps/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ define_maps! { <'tcx>
299299

300300
[] fn impl_defaultness: ImplDefaultness(DefId) -> hir::Defaultness,
301301

302+
[] fn check_item_well_formed: CheckItemWellFormed(DefId) -> (),
303+
[] fn check_trait_item_well_formed: CheckTraitItemWellFormed(DefId) -> (),
304+
[] fn check_impl_item_well_formed: CheckImplItemWellFormed(DefId) -> (),
305+
302306
// The DefIds of all non-generic functions and statics in the given crate
303307
// that can be reached from outside the crate.
304308
//

Diff for: src/librustc/ty/maps/plumbing.rs

+3
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,9 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
871871
DepKind::GetPanicStrategy => { force!(panic_strategy, krate!()); }
872872
DepKind::IsNoBuiltins => { force!(is_no_builtins, krate!()); }
873873
DepKind::ImplDefaultness => { force!(impl_defaultness, def_id!()); }
874+
DepKind::CheckItemWellFormed => { force!(check_item_well_formed, def_id!()); }
875+
DepKind::CheckTraitItemWellFormed => { force!(check_trait_item_well_formed, def_id!()); }
876+
DepKind::CheckImplItemWellFormed => { force!(check_impl_item_well_formed, def_id!()); }
874877
DepKind::ReachableNonGenerics => { force!(reachable_non_generics, krate!()); }
875878
DepKind::NativeLibraries => { force!(native_libraries, krate!()); }
876879
DepKind::PluginRegistrarFn => { force!(plugin_registrar_fn, krate!()); }

Diff for: src/librustc_typeck/check/mod.rs

+15
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,28 @@ fn typeck_item_bodies<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum
718718
})?)
719719
}
720720

721+
fn check_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
722+
wfcheck::check_item_well_formed(tcx, def_id);
723+
}
724+
725+
fn check_trait_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
726+
wfcheck::check_trait_item(tcx, def_id);
727+
}
728+
729+
fn check_impl_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
730+
wfcheck::check_impl_item(tcx, def_id);
731+
}
732+
721733
pub fn provide(providers: &mut Providers) {
722734
*providers = Providers {
723735
typeck_item_bodies,
724736
typeck_tables_of,
725737
has_typeck_tables,
726738
adt_destructor,
727739
used_trait_imports,
740+
check_item_well_formed,
741+
check_trait_item_well_formed,
742+
check_impl_item_well_formed,
728743
..*providers
729744
};
730745
}

0 commit comments

Comments
 (0)