diff options
| author | bors <bors@rust-lang.org> | 2022-02-24 10:02:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-02-24 10:02:26 +0000 |
| commit | 7ccfe2ff1d59666dc0188dfd5847304fec257565 (patch) | |
| tree | 48ab85a723d1398aa894f6fe89e88d01986b8f57 /compiler/rustc_middle/src/middle | |
| parent | 1204400ab8da9830f6f77a5e40e7ad3ea459676a (diff) | |
| parent | 7afcf9fcd14af52e53e38ffe60b1eac9b3232b21 (diff) | |
| download | rust-7ccfe2ff1d59666dc0188dfd5847304fec257565.tar.gz rust-7ccfe2ff1d59666dc0188dfd5847304fec257565.zip | |
Auto merge of #94129 - cjgillot:rmeta-table, r=petrochenkov
Back more metadata using per-query tables r? `@ghost`
Diffstat (limited to 'compiler/rustc_middle/src/middle')
| -rw-r--r-- | compiler/rustc_middle/src/middle/stability.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs index ac4a5985c2f..7a7d2470444 100644 --- a/compiler/rustc_middle/src/middle/stability.rs +++ b/compiler/rustc_middle/src/middle/stability.rs @@ -57,11 +57,11 @@ impl DeprecationEntry { /// A stability index, giving the stability level for items and methods. #[derive(HashStable, Debug)] -pub struct Index<'tcx> { +pub struct Index { /// This is mostly a cache, except the stabilities of local items /// are filled by the annotator. - pub stab_map: FxHashMap<LocalDefId, &'tcx Stability>, - pub const_stab_map: FxHashMap<LocalDefId, &'tcx ConstStability>, + pub stab_map: FxHashMap<LocalDefId, Stability>, + pub const_stab_map: FxHashMap<LocalDefId, ConstStability>, pub depr_map: FxHashMap<LocalDefId, DeprecationEntry>, /// Maps for each crate whether it is part of the staged API. @@ -71,12 +71,12 @@ pub struct Index<'tcx> { pub active_features: FxHashSet<Symbol>, } -impl<'tcx> Index<'tcx> { - pub fn local_stability(&self, def_id: LocalDefId) -> Option<&'tcx Stability> { +impl Index { + pub fn local_stability(&self, def_id: LocalDefId) -> Option<Stability> { self.stab_map.get(&def_id).copied() } - pub fn local_const_stability(&self, def_id: LocalDefId) -> Option<&'tcx ConstStability> { + pub fn local_const_stability(&self, def_id: LocalDefId) -> Option<ConstStability> { self.const_stab_map.get(&def_id).copied() } @@ -416,7 +416,7 @@ impl<'tcx> TyCtxt<'tcx> { } match stability { - Some(&Stability { + Some(Stability { level: attr::Unstable { reason, issue, is_soft }, feature, .. }) => { if span.allows_unstable(feature) { |
