@@ -29,7 +29,7 @@ use rustc_data_structures::fx::FxHashMap;
2929use rustc_data_structures:: fx:: FxIndexMap ;
3030use rustc_data_structures:: sorted_map:: SortedIndexMultiMap ;
3131use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
32- use rustc_data_structures:: sync:: { self , par_iter, Lrc , ParallelIterator } ;
32+ use rustc_data_structures:: sync:: { self , par_iter, ParallelIterator } ;
3333use rustc_hir as hir;
3434use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , Namespace , Res } ;
3535use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LocalDefId , CRATE_DEF_INDEX } ;
@@ -2760,22 +2760,7 @@ impl BorrowKind {
27602760 }
27612761}
27622762
2763- #[ derive( Debug , Clone ) ]
2764- pub enum Attributes < ' tcx > {
2765- Owned ( Lrc < [ ast:: Attribute ] > ) ,
2766- Borrowed ( & ' tcx [ ast:: Attribute ] ) ,
2767- }
2768-
2769- impl < ' tcx > :: std:: ops:: Deref for Attributes < ' tcx > {
2770- type Target = [ ast:: Attribute ] ;
2771-
2772- fn deref ( & self ) -> & [ ast:: Attribute ] {
2773- match self {
2774- & Attributes :: Owned ( ref data) => & data,
2775- & Attributes :: Borrowed ( data) => data,
2776- }
2777- }
2778- }
2763+ pub type Attributes < ' tcx > = & ' tcx [ ast:: Attribute ] ;
27792764
27802765#[ derive( Debug , PartialEq , Eq ) ]
27812766pub enum ImplOverlapKind {
@@ -3011,9 +2996,9 @@ impl<'tcx> TyCtxt<'tcx> {
30112996 /// Gets the attributes of a definition.
30122997 pub fn get_attrs ( self , did : DefId ) -> Attributes < ' tcx > {
30132998 if let Some ( id) = self . hir ( ) . as_local_hir_id ( did) {
3014- Attributes :: Borrowed ( self . hir ( ) . attrs ( id) )
2999+ self . hir ( ) . attrs ( id)
30153000 } else {
3016- Attributes :: Borrowed ( self . item_attrs ( did) )
3001+ self . item_attrs ( did)
30173002 }
30183003 }
30193004
0 commit comments