@@ -171,13 +171,6 @@ impl<'a, 'tcx: 'a> Annotator<'a, 'tcx> {
171171 attr:: mark_used ( attr) ;
172172 self . tcx . sess . span_err ( attr. span ( ) , "stability attributes may not be used \
173173 outside of the standard library") ;
174- } else if tag == "deprecated" {
175- if !self . tcx . sess . features . borrow ( ) . deprecated {
176- self . tcx . sess . span_err ( attr. span ( ) ,
177- "`#[deprecated]` attribute is unstable" ) ;
178- fileline_help ! ( self . tcx. sess, attr. span( ) , "add #![feature(deprecated)] to \
179- the crate features to enable") ;
180- }
181174 }
182175 }
183176
@@ -687,68 +680,20 @@ pub fn lookup_deprecation<'tcx>(tcx: &ty::ctxt<'tcx>, id: DefId) -> Option<Depre
687680
688681fn lookup_stability_uncached < ' tcx > ( tcx : & ty:: ctxt < ' tcx > , id : DefId ) -> Option < & ' tcx Stability > {
689682 debug ! ( "lookup(id={:?})" , id) ;
690-
691- // is this definition the implementation of a trait method?
692- match tcx. trait_item_of_item ( id) {
693- Some ( ty:: MethodTraitItemId ( trait_method_id) ) if trait_method_id != id => {
694- debug ! ( "lookup: trait_method_id={:?}" , trait_method_id) ;
695- return lookup_stability ( tcx, trait_method_id)
696- }
697- _ => { }
698- }
699-
700- let item_stab = if id. is_local ( ) {
683+ if id. is_local ( ) {
701684 None // The stability cache is filled partially lazily
702685 } else {
703686 tcx. sess . cstore . stability ( id) . map ( |st| tcx. intern_stability ( st) )
704- } ;
705-
706- item_stab. or_else ( || {
707- if tcx. is_impl ( id) {
708- if let Some ( trait_id) = tcx. trait_id_of_impl ( id) {
709- // FIXME (#18969): for the time being, simply use the
710- // stability of the trait to determine the stability of any
711- // unmarked impls for it. See FIXME above for more details.
712-
713- debug ! ( "lookup: trait_id={:?}" , trait_id) ;
714- return lookup_stability ( tcx, trait_id) ;
715- }
716- }
717- None
718- } )
687+ }
719688}
720689
721690fn lookup_deprecation_uncached < ' tcx > ( tcx : & ty:: ctxt < ' tcx > , id : DefId ) -> Option < Deprecation > {
722691 debug ! ( "lookup(id={:?})" , id) ;
723-
724- // is this definition the implementation of a trait method?
725- match tcx. trait_item_of_item ( id) {
726- Some ( ty:: MethodTraitItemId ( trait_method_id) ) if trait_method_id != id => {
727- debug ! ( "lookup: trait_method_id={:?}" , trait_method_id) ;
728- return lookup_deprecation ( tcx, trait_method_id)
729- }
730- _ => { }
731- }
732-
733- let item_depr = if id. is_local ( ) {
692+ if id. is_local ( ) {
734693 None // The stability cache is filled partially lazily
735694 } else {
736695 tcx. sess . cstore . deprecation ( id)
737- } ;
738-
739- item_depr. or_else ( || {
740- if tcx. is_impl ( id) {
741- if let Some ( trait_id) = tcx. trait_id_of_impl ( id) {
742- // FIXME (#18969): for the time being, simply use the
743- // stability of the trait to determine the stability of any
744- // unmarked impls for it. See FIXME above for more details.
745-
746- debug ! ( "lookup: trait_id={:?}" , trait_id) ;
747- return lookup_deprecation ( tcx, trait_id) ;
748- }
749- }
750- None
751- } )
696+ }
752697}
753698
754699/// Given the list of enabled features that were not language features (i.e. that
0 commit comments