@@ -87,9 +87,9 @@ impl InheritStability {
8787// A private tree-walker for producing an Index.
8888struct Annotator < ' a , ' tcx > {
8989 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 > ,
9393 parent_depr : Option < DeprecationEntry > ,
9494 in_trait_impl : bool ,
9595}
@@ -171,7 +171,6 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
171171 let mut const_span = None ;
172172
173173 let const_stab = const_stab. map ( |( const_stab, const_span_node) | {
174- let const_stab = self . tcx . intern_const_stability ( const_stab) ;
175174 self . index . const_stab_map . insert ( def_id, const_stab) ;
176175 const_span = Some ( const_span_node) ;
177176 const_stab
@@ -228,7 +227,6 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
228227 }
229228
230229 debug ! ( "annotate: found {:?}" , stab) ;
231- let stab = self . tcx . intern_stability ( stab) ;
232230
233231 // Check if deprecated_since < stable_since. If it is,
234232 // this is *almost surely* an accident.
@@ -299,8 +297,8 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
299297 fn recurse_with_stability_attrs (
300298 & mut self ,
301299 depr : Option < DeprecationEntry > ,
302- stab : Option < & ' tcx Stability > ,
303- const_stab : Option < & ' tcx ConstStability > ,
300+ stab : Option < Stability > ,
301+ const_stab : Option < ConstStability > ,
304302 f : impl FnOnce ( & mut Self ) ,
305303 ) {
306304 // These will be `Some` if this item changes the corresponding stability attribute.
@@ -655,7 +653,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
655653 // stable (assuming they have not inherited instability from their parent).
656654}
657655
658- fn stability_index < ' tcx > ( tcx : TyCtxt < ' tcx > , ( ) : ( ) ) -> Index < ' tcx > {
656+ fn stability_index ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> Index {
659657 let is_staged_api =
660658 tcx. sess . opts . debugging_opts . force_unstable_if_unmarked || tcx. features ( ) . staged_api ;
661659 let mut staged_api = FxHashMap :: default ( ) ;
@@ -698,14 +696,14 @@ fn stability_index<'tcx>(tcx: TyCtxt<'tcx>, (): ()) -> Index<'tcx> {
698696 let reason = "this crate is being loaded from the sysroot, an \
699697 unstable location; did you mean to load this crate \
700698 from crates.io via `Cargo.toml` instead?";
701- let stability = tcx . intern_stability ( Stability {
699+ let stability = Stability {
702700 level : attr:: StabilityLevel :: Unstable {
703701 reason : Some ( Symbol :: intern ( reason) ) ,
704702 issue : NonZeroU32 :: new ( 27812 ) ,
705703 is_soft : false ,
706704 } ,
707705 feature : sym:: rustc_private,
708- } ) ;
706+ } ;
709707 annotator. parent_stab = Some ( stability) ;
710708 }
711709
0 commit comments