diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-01-16 22:26:46 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-03 18:22:31 +0100 |
| commit | 6f8e9f416a49993670056d9d9e0601e4e25ecf28 (patch) | |
| tree | 49d21f8f80de12bd351594719b4993e079efed76 | |
| parent | 1b4b5e066b2f11b993118cadf3994d07534eb294 (diff) | |
Move query providers.
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index d32276364e0..1661f4ef0ed 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2999,11 +2999,6 @@ pub fn provide(providers: &mut ty::query::Providers) { tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default()) }; - providers.lookup_stability = |tcx, id| tcx.stability().local_stability(id.expect_local()); - providers.lookup_const_stability = - |tcx, id| tcx.stability().local_const_stability(id.expect_local()); - providers.lookup_deprecation_entry = - |tcx, id| tcx.stability().local_deprecation_entry(id.expect_local()); providers.extern_mod_stmt_cnum = |tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned(); providers.output_filenames = |tcx, ()| &tcx.output_filenames; diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 3e29dc4274f..54c52720ef7 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -712,7 +712,16 @@ fn check_mod_unstable_api_usage(tcx: TyCtxt<'_>, module_def_id: LocalDefId) { } pub(crate) fn provide(providers: &mut Providers) { - *providers = Providers { check_mod_unstable_api_usage, stability_index, ..*providers }; + *providers = Providers { + check_mod_unstable_api_usage, + stability_index, + lookup_stability: |tcx, id| tcx.stability().local_stability(id.expect_local()), + lookup_const_stability: |tcx, id| tcx.stability().local_const_stability(id.expect_local()), + lookup_deprecation_entry: |tcx, id| { + tcx.stability().local_deprecation_entry(id.expect_local()) + }, + ..*providers + }; } struct Checker<'tcx> { |
