File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,34 +235,6 @@ impl AttributeExt for Attribute {
235235 }
236236 }
237237
238- fn deprecation_note ( & self ) -> Option < Ident > {
239- match & self . kind {
240- AttrKind :: Normal ( normal) if normal. item . path == sym:: deprecated => {
241- let meta = & normal. item ;
242-
243- // #[deprecated = "..."]
244- if let Some ( s) = meta. value_str ( ) {
245- return Some ( Ident { name : s, span : meta. span ( ) } ) ;
246- }
247-
248- // #[deprecated(note = "...")]
249- if let Some ( list) = meta. meta_item_list ( ) {
250- for nested in list {
251- if let Some ( mi) = nested. meta_item ( )
252- && mi. path == sym:: note
253- && let Some ( s) = mi. value_str ( )
254- {
255- return Some ( Ident { name : s, span : mi. span } ) ;
256- }
257- }
258- }
259-
260- None
261- }
262- _ => None ,
263- }
264- }
265-
266238 fn doc_resolution_scope ( & self ) -> Option < AttrStyle > {
267239 match & self . kind {
268240 AttrKind :: DocComment ( ..) => Some ( self . style ) ,
Original file line number Diff line number Diff line change @@ -1415,14 +1415,6 @@ impl AttributeExt for Attribute {
14151415 }
14161416 }
14171417
1418- #[ inline]
1419- fn deprecation_note ( & self ) -> Option < Ident > {
1420- match & self {
1421- Attribute :: Parsed ( AttributeKind :: Deprecated { deprecation, .. } ) => deprecation. note ,
1422- _ => None ,
1423- }
1424- }
1425-
14261418 fn is_automatically_derived_attr ( & self ) -> bool {
14271419 matches ! ( self , Attribute :: Parsed ( AttributeKind :: AutomaticallyDerived ( ..) ) )
14281420 }
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ use arrayvec::ArrayVec;
88use itertools:: Either ;
99use rustc_abi:: { ExternAbi , VariantIdx } ;
1010use rustc_ast as ast;
11- use rustc_ast:: attr:: AttributeExt ;
1211use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap , FxIndexSet } ;
1312use rustc_data_structures:: thin_vec:: ThinVec ;
1413use rustc_hir as hir;
@@ -501,11 +500,7 @@ impl Item {
501500 }
502501
503502 pub ( crate ) fn attr_span ( & self , tcx : TyCtxt < ' _ > ) -> rustc_span:: Span {
504- let deprecation_notes = self
505- . attrs
506- . other_attrs
507- . iter ( )
508- . filter_map ( |attr| attr. deprecation_note ( ) . map ( |note| note. span ) ) ;
503+ let deprecation_notes = find_attr ! ( & self . attrs. other_attrs, Deprecated { deprecation, .. } => deprecation. note. map( |note| note. span) ) . flatten ( ) ;
509504
510505 span_of_fragments ( & self . attrs . doc_strings )
511506 . into_iter ( )
You can’t perform that action at this time.
0 commit comments