Skip to content

Commit 7fcf0e2

Browse files
committed
Move query providers.
1 parent ac27ac0 commit 7fcf0e2

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
@@ -2970,11 +2970,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
29702970
tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default())
29712971
};
29722972

2973-
providers.lookup_stability = |tcx, id| tcx.stability().local_stability(id.expect_local());
2974-
providers.lookup_const_stability =
2975-
|tcx, id| tcx.stability().local_const_stability(id.expect_local());
2976-
providers.lookup_deprecation_entry =
2977-
|tcx, id| tcx.stability().local_deprecation_entry(id.expect_local());
29782973
providers.extern_mod_stmt_cnum =
29792974
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
29802975
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
@@ -712,7 +712,16 @@ fn check_mod_unstable_api_usage(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
712712
}
713713

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

718727
struct Checker<'tcx> {

0 commit comments

Comments
 (0)