@@ -87,9 +87,9 @@ impl InheritStability {
87
87
// A private tree-walker for producing an Index.
88
88
struct Annotator < ' a , ' tcx > {
89
89
tcx : TyCtxt < ' tcx > ,
90
- index : & ' a mut Index < ' tcx > ,
91
- parent_stab : Option < & ' tcx Stability > ,
92
- parent_const_stab : Option < & ' tcx ConstStability > ,
90
+ index : & ' a mut Index ,
91
+ parent_stab : Option < Stability > ,
92
+ parent_const_stab : Option < ConstStability > ,
93
93
parent_depr : Option < DeprecationEntry > ,
94
94
in_trait_impl : bool ,
95
95
}
@@ -171,7 +171,6 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
171
171
let mut const_span = None ;
172
172
173
173
let const_stab = const_stab. map ( |( const_stab, const_span_node) | {
174
- let const_stab = self . tcx . intern_const_stability ( const_stab) ;
175
174
self . index . const_stab_map . insert ( def_id, const_stab) ;
176
175
const_span = Some ( const_span_node) ;
177
176
const_stab
@@ -228,7 +227,6 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
228
227
}
229
228
230
229
debug ! ( "annotate: found {:?}" , stab) ;
231
- let stab = self . tcx . intern_stability ( stab) ;
232
230
233
231
// Check if deprecated_since < stable_since. If it is,
234
232
// this is *almost surely* an accident.
@@ -299,8 +297,8 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
299
297
fn recurse_with_stability_attrs (
300
298
& mut self ,
301
299
depr : Option < DeprecationEntry > ,
302
- stab : Option < & ' tcx Stability > ,
303
- const_stab : Option < & ' tcx ConstStability > ,
300
+ stab : Option < Stability > ,
301
+ const_stab : Option < ConstStability > ,
304
302
f : impl FnOnce ( & mut Self ) ,
305
303
) {
306
304
// These will be `Some` if this item changes the corresponding stability attribute.
@@ -655,7 +653,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
655
653
// stable (assuming they have not inherited instability from their parent).
656
654
}
657
655
658
- fn stability_index < ' tcx > ( tcx : TyCtxt < ' tcx > , ( ) : ( ) ) -> Index < ' tcx > {
656
+ fn stability_index ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> Index {
659
657
let is_staged_api =
660
658
tcx. sess . opts . debugging_opts . force_unstable_if_unmarked || tcx. features ( ) . staged_api ;
661
659
let mut staged_api = FxHashMap :: default ( ) ;
@@ -698,14 +696,14 @@ fn stability_index<'tcx>(tcx: TyCtxt<'tcx>, (): ()) -> Index<'tcx> {
698
696
let reason = "this crate is being loaded from the sysroot, an \
699
697
unstable location; did you mean to load this crate \
700
698
from crates.io via `Cargo.toml` instead?";
701
- let stability = tcx . intern_stability ( Stability {
699
+ let stability = Stability {
702
700
level : attr:: StabilityLevel :: Unstable {
703
701
reason : Some ( Symbol :: intern ( reason) ) ,
704
702
issue : NonZeroU32 :: new ( 27812 ) ,
705
703
is_soft : false ,
706
704
} ,
707
705
feature : sym:: rustc_private,
708
- } ) ;
706
+ } ;
709
707
annotator. parent_stab = Some ( stability) ;
710
708
}
711
709
0 commit comments