@@ -758,7 +758,7 @@ pub struct Crate<'hir> {
758758 // slightly different results.
759759 pub items : BTreeMap < HirId , Item < ' hir > > ,
760760
761- pub trait_items : BTreeMap < TraitItemId , TraitItem > ,
761+ pub trait_items : BTreeMap < TraitItemId , TraitItem < ' hir > > ,
762762 pub impl_items : BTreeMap < ImplItemId , ImplItem > ,
763763 pub bodies : BTreeMap < BodyId , Body > ,
764764 pub trait_impls : BTreeMap < DefId , Vec < HirId > > ,
@@ -779,7 +779,7 @@ impl Crate<'hir> {
779779 & self . items [ & id]
780780 }
781781
782- pub fn trait_item ( & self , id : TraitItemId ) -> & TraitItem {
782+ pub fn trait_item ( & self , id : TraitItemId ) -> & TraitItem < ' hir > {
783783 & self . trait_items [ & id]
784784 }
785785
@@ -1897,12 +1897,12 @@ pub struct TraitItemId {
18971897/// either required (meaning it doesn't have an implementation, just a
18981898/// signature) or provided (meaning it has a default implementation).
18991899#[ derive( RustcEncodable , RustcDecodable , Debug ) ]
1900- pub struct TraitItem {
1900+ pub struct TraitItem < ' hir > {
19011901 pub ident : Ident ,
19021902 pub hir_id : HirId ,
1903- pub attrs : HirVec < Attribute > ,
1903+ pub attrs : & ' hir [ Attribute ] ,
19041904 pub generics : Generics ,
1905- pub kind : TraitItemKind ,
1905+ pub kind : TraitItemKind < ' hir > ,
19061906 pub span : Span ,
19071907}
19081908
@@ -1918,14 +1918,14 @@ pub enum TraitMethod {
19181918
19191919/// Represents a trait method or associated constant or type
19201920#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
1921- pub enum TraitItemKind {
1921+ pub enum TraitItemKind < ' hir > {
19221922 /// 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 > ) ,
19241924 /// A method with an optional body.
19251925 Method ( FnSig , TraitMethod ) ,
19261926 /// An associated type with (possibly empty) bounds and optional concrete
19271927 /// type.
1928- Type ( GenericBounds , Option < P < Ty > > ) ,
1928+ Type ( GenericBounds , Option < & ' hir Ty > ) ,
19291929}
19301930
19311931// The bodies for items are stored "out of line", in a separate
@@ -2789,7 +2789,7 @@ pub enum Node<'hir> {
27892789 Param ( & ' hir Param ) ,
27902790 Item ( & ' hir Item < ' hir > ) ,
27912791 ForeignItem ( & ' hir ForeignItem < ' hir > ) ,
2792- TraitItem ( & ' hir TraitItem ) ,
2792+ TraitItem ( & ' hir TraitItem < ' hir > ) ,
27932793 ImplItem ( & ' hir ImplItem ) ,
27942794 Variant ( & ' hir Variant ) ,
27952795 Field ( & ' hir StructField ) ,
0 commit comments