@@ -758,7 +758,7 @@ pub struct Crate<'hir> {
758
758
// slightly different results.
759
759
pub items : BTreeMap < HirId , Item < ' hir > > ,
760
760
761
- pub trait_items : BTreeMap < TraitItemId , TraitItem > ,
761
+ pub trait_items : BTreeMap < TraitItemId , TraitItem < ' hir > > ,
762
762
pub impl_items : BTreeMap < ImplItemId , ImplItem > ,
763
763
pub bodies : BTreeMap < BodyId , Body > ,
764
764
pub trait_impls : BTreeMap < DefId , Vec < HirId > > ,
@@ -779,7 +779,7 @@ impl Crate<'hir> {
779
779
& self . items [ & id]
780
780
}
781
781
782
- pub fn trait_item ( & self , id : TraitItemId ) -> & TraitItem {
782
+ pub fn trait_item ( & self , id : TraitItemId ) -> & TraitItem < ' hir > {
783
783
& self . trait_items [ & id]
784
784
}
785
785
@@ -1897,12 +1897,12 @@ pub struct TraitItemId {
1897
1897
/// either required (meaning it doesn't have an implementation, just a
1898
1898
/// signature) or provided (meaning it has a default implementation).
1899
1899
#[ derive( RustcEncodable , RustcDecodable , Debug ) ]
1900
- pub struct TraitItem {
1900
+ pub struct TraitItem < ' hir > {
1901
1901
pub ident : Ident ,
1902
1902
pub hir_id : HirId ,
1903
- pub attrs : HirVec < Attribute > ,
1903
+ pub attrs : & ' hir [ Attribute ] ,
1904
1904
pub generics : Generics ,
1905
- pub kind : TraitItemKind ,
1905
+ pub kind : TraitItemKind < ' hir > ,
1906
1906
pub span : Span ,
1907
1907
}
1908
1908
@@ -1918,14 +1918,14 @@ pub enum TraitMethod {
1918
1918
1919
1919
/// Represents a trait method or associated constant or type
1920
1920
#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
1921
- pub enum TraitItemKind {
1921
+ pub enum TraitItemKind < ' hir > {
1922
1922
/// An associated constant with an optional value (otherwise `impl`s must contain a value).
1923
- Const ( P < Ty > , Option < BodyId > ) ,
1923
+ Const ( & ' hir Ty , Option < BodyId > ) ,
1924
1924
/// A method with an optional body.
1925
1925
Method ( FnSig , TraitMethod ) ,
1926
1926
/// An associated type with (possibly empty) bounds and optional concrete
1927
1927
/// type.
1928
- Type ( GenericBounds , Option < P < Ty > > ) ,
1928
+ Type ( GenericBounds , Option < & ' hir Ty > ) ,
1929
1929
}
1930
1930
1931
1931
// The bodies for items are stored "out of line", in a separate
@@ -2789,7 +2789,7 @@ pub enum Node<'hir> {
2789
2789
Param ( & ' hir Param ) ,
2790
2790
Item ( & ' hir Item < ' hir > ) ,
2791
2791
ForeignItem ( & ' hir ForeignItem < ' hir > ) ,
2792
- TraitItem ( & ' hir TraitItem ) ,
2792
+ TraitItem ( & ' hir TraitItem < ' hir > ) ,
2793
2793
ImplItem ( & ' hir ImplItem ) ,
2794
2794
Variant ( & ' hir Variant ) ,
2795
2795
Field ( & ' hir StructField ) ,
0 commit comments