Skip to content

Commit 6f8e9f4

Browse files
committed
Move query providers.
1 parent 1b4b5e0 commit 6f8e9f4

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

3002-
providers.lookup_stability = |tcx, id| tcx.stability().local_stability(id.expect_local());
3003-
providers.lookup_const_stability =
3004-
|tcx, id| tcx.stability().local_const_stability(id.expect_local());
3005-
providers.lookup_deprecation_entry =
3006-
|tcx, id| tcx.stability().local_deprecation_entry(id.expect_local());
30073002
providers.extern_mod_stmt_cnum =
30083003
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
30093004
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)