@@ -29,7 +29,7 @@ use rustc_data_structures::fx::FxHashMap;
29
29
use rustc_data_structures:: fx:: FxIndexMap ;
30
30
use rustc_data_structures:: sorted_map:: SortedIndexMultiMap ;
31
31
use 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 } ;
33
33
use rustc_hir as hir;
34
34
use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , Namespace , Res } ;
35
35
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LocalDefId , CRATE_DEF_INDEX } ;
@@ -2760,22 +2760,7 @@ impl BorrowKind {
2760
2760
}
2761
2761
}
2762
2762
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 ] ;
2779
2764
2780
2765
#[ derive( Debug , PartialEq , Eq ) ]
2781
2766
pub enum ImplOverlapKind {
@@ -3011,9 +2996,9 @@ impl<'tcx> TyCtxt<'tcx> {
3011
2996
/// Gets the attributes of a definition.
3012
2997
pub fn get_attrs ( self , did : DefId ) -> Attributes < ' tcx > {
3013
2998
if let Some ( id) = self . hir ( ) . as_local_hir_id ( did) {
3014
- Attributes :: Borrowed ( self . hir ( ) . attrs ( id) )
2999
+ self . hir ( ) . attrs ( id)
3015
3000
} else {
3016
- Attributes :: Borrowed ( self . item_attrs ( did) )
3001
+ self . item_attrs ( did)
3017
3002
}
3018
3003
}
3019
3004
0 commit comments