@@ -38,7 +38,7 @@ use log::debug;
3838pub struct DecodeContext < ' a , ' tcx > {
3939 opaque : opaque:: Decoder < ' a > ,
4040 cdata : Option < & ' a CrateMetadata > ,
41- sess : Option < & ' a Session > ,
41+ sess : Option < & ' tcx Session > ,
4242 tcx : Option < TyCtxt < ' tcx > > ,
4343
4444 // Cache the last used source_file for translating spans as an optimization.
@@ -54,10 +54,8 @@ pub struct DecodeContext<'a, 'tcx> {
5454pub trait Metadata < ' a , ' tcx > : Copy {
5555 fn raw_bytes ( self ) -> & ' a [ u8 ] ;
5656 fn cdata ( self ) -> Option < & ' a CrateMetadata > { None }
57- fn sess ( self ) -> Option < & ' a Session > { None }
58- fn tcx ( self ) -> Option < TyCtxt < ' tcx > > {
59- None
60- }
57+ fn sess ( self ) -> Option < & ' tcx Session > { None }
58+ fn tcx ( self ) -> Option < TyCtxt < ' tcx > > { None }
6159
6260 fn decoder ( self , pos : usize ) -> DecodeContext < ' a , ' tcx > {
6361 let tcx = self . tcx ( ) ;
@@ -82,13 +80,13 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for &'a MetadataBlob {
8280}
8381
8482
85- impl < ' a , ' tcx > Metadata < ' a , ' tcx > for ( & ' a MetadataBlob , & ' a Session ) {
83+ impl < ' a , ' tcx > Metadata < ' a , ' tcx > for ( & ' a MetadataBlob , & ' tcx Session ) {
8684 fn raw_bytes ( self ) -> & ' a [ u8 ] {
8785 let ( blob, _) = self ;
8886 & blob. 0
8987 }
9088
91- fn sess ( self ) -> Option < & ' a Session > {
89+ fn sess ( self ) -> Option < & ' tcx Session > {
9290 let ( _, sess) = self ;
9391 Some ( sess)
9492 }
@@ -104,14 +102,14 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for &'a CrateMetadata {
104102 }
105103}
106104
107- impl < ' a , ' tcx > Metadata < ' a , ' tcx > for ( & ' a CrateMetadata , & ' a Session ) {
105+ impl < ' a , ' tcx > Metadata < ' a , ' tcx > for ( & ' a CrateMetadata , & ' tcx Session ) {
108106 fn raw_bytes ( self ) -> & ' a [ u8 ] {
109107 self . 0 . raw_bytes ( )
110108 }
111109 fn cdata ( self ) -> Option < & ' a CrateMetadata > {
112110 Some ( self . 0 )
113111 }
114- fn sess ( self ) -> Option < & ' a Session > {
112+ fn sess ( self ) -> Option < & ' tcx Session > {
115113 Some ( & self . 1 )
116114 }
117115}
@@ -136,11 +134,11 @@ impl<'a, 'tcx, T: Decodable> Lazy<T> {
136134 }
137135}
138136
139- impl < ' a , ' tcx , T : Decodable > LazySeq < T > {
137+ impl < ' a : ' x , ' tcx : ' x , ' x , T : Decodable > LazySeq < T > {
140138 pub fn decode < M : Metadata < ' a , ' tcx > > (
141139 self ,
142140 meta : M ,
143- ) -> impl Iterator < Item = T > + Captures < ' tcx > + ' a {
141+ ) -> impl Iterator < Item = T > + Captures < ' a > + Captures < ' tcx > + ' x {
144142 let mut dcx = meta. decoder ( self . position ) ;
145143 dcx. lazy_state = LazyState :: NodeStart ( self . position ) ;
146144 ( 0 ..self . len ) . map ( move |_| T :: decode ( & mut dcx) . unwrap ( ) )
0 commit comments