Skip to content

Commit 17daa96

Browse files
committed
Move query providers.
1 parent 44ae1cb commit 17daa96

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,11 +2964,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
29642964
tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default())
29652965
};
29662966

2967-
providers.lookup_stability = |tcx, id| tcx.stability().local_stability(id.expect_local());
2968-
providers.lookup_const_stability =
2969-
|tcx, id| tcx.stability().local_const_stability(id.expect_local());
2970-
providers.lookup_deprecation_entry =
2971-
|tcx, id| tcx.stability().local_deprecation_entry(id.expect_local());
29722967
providers.extern_mod_stmt_cnum =
29732968
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
29742969
providers.output_filenames = |tcx, ()| &tcx.output_filenames;

compiler/rustc_passes/src/stability.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,16 @@ fn check_mod_unstable_api_usage(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
714714
}
715715

716716
pub(crate) fn provide(providers: &mut Providers) {
717-
*providers = Providers { check_mod_unstable_api_usage, stability_index, ..*providers };
717+
*providers = Providers {
718+
check_mod_unstable_api_usage,
719+
stability_index,
720+
lookup_stability: |tcx, id| tcx.stability().local_stability(id.expect_local()),
721+
lookup_const_stability: |tcx, id| tcx.stability().local_const_stability(id.expect_local()),
722+
lookup_deprecation_entry: |tcx, id| {
723+
tcx.stability().local_deprecation_entry(id.expect_local())
724+
},
725+
..*providers
726+
};
718727
}
719728

720729
struct Checker<'tcx> {

0 commit comments

Comments
 (0)