@@ -23,7 +23,7 @@ use std::mem;
23
23
use syntax:: ast:: NodeId ;
24
24
use syntax:: source_map:: { SourceMap , StableSourceFileId } ;
25
25
use syntax_pos:: { BytePos , Span , DUMMY_SP , SourceFile } ;
26
- use syntax_pos:: hygiene:: { ExpnId , SyntaxContext , ExpnData } ;
26
+ use syntax_pos:: hygiene:: { ExpnId , SyntaxContext } ;
27
27
28
28
const TAG_FILE_FOOTER : u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE ;
29
29
@@ -593,8 +593,8 @@ impl<'a, 'tcx> SpecializedDecoder<Span> for CacheDecoder<'a, 'tcx> {
593
593
// don't seem to be used after HIR lowering, so everything should be fine
594
594
// as long as incremental compilation does not kick in before that.
595
595
let location = || Span :: with_root_ctxt ( lo, hi) ;
596
- let recover_from_expn_data = |this : & Self , expn_data, pos| {
597
- let span = location ( ) . fresh_expansion ( expn_data) ;
596
+ let recover_from_expn_data = |this : & Self , expn_data, transparency , pos| {
597
+ let span = location ( ) . fresh_expansion_with_transparency ( expn_data, transparency ) ;
598
598
this. synthetic_syntax_contexts . borrow_mut ( ) . insert ( pos, span. ctxt ( ) ) ;
599
599
span
600
600
} ;
@@ -603,9 +603,9 @@ impl<'a, 'tcx> SpecializedDecoder<Span> for CacheDecoder<'a, 'tcx> {
603
603
location ( )
604
604
}
605
605
TAG_EXPN_DATA_INLINE => {
606
- let expn_data = Decodable :: decode ( self ) ?;
606
+ let ( expn_data, transparency ) = Decodable :: decode ( self ) ?;
607
607
recover_from_expn_data (
608
- self , expn_data, AbsoluteBytePos :: new ( self . opaque . position ( ) )
608
+ self , expn_data, transparency , AbsoluteBytePos :: new ( self . opaque . position ( ) )
609
609
)
610
610
}
611
611
TAG_EXPN_DATA_SHORTHAND => {
@@ -614,9 +614,9 @@ impl<'a, 'tcx> SpecializedDecoder<Span> for CacheDecoder<'a, 'tcx> {
614
614
if let Some ( ctxt) = cached_ctxt {
615
615
Span :: new ( lo, hi, ctxt)
616
616
} else {
617
- let expn_data =
618
- self . with_position ( pos. to_usize ( ) , |this| ExpnData :: decode ( this) ) ?;
619
- recover_from_expn_data ( self , expn_data, pos)
617
+ let ( expn_data, transparency ) =
618
+ self . with_position ( pos. to_usize ( ) , |this| Decodable :: decode ( this) ) ?;
619
+ recover_from_expn_data ( self , expn_data, transparency , pos)
620
620
}
621
621
}
622
622
_ => {
@@ -819,15 +819,15 @@ where
819
819
if span_data. ctxt == SyntaxContext :: root ( ) {
820
820
TAG_NO_EXPN_DATA . encode ( self )
821
821
} else {
822
- let ( expn_id, expn_data) = span_data. ctxt . outer_expn_with_data ( ) ;
822
+ let ( expn_id, transparency , expn_data) = span_data. ctxt . outer_mark_with_data ( ) ;
823
823
if let Some ( pos) = self . expn_data_shorthands . get ( & expn_id) . cloned ( ) {
824
824
TAG_EXPN_DATA_SHORTHAND . encode ( self ) ?;
825
825
pos. encode ( self )
826
826
} else {
827
827
TAG_EXPN_DATA_INLINE . encode ( self ) ?;
828
828
let pos = AbsoluteBytePos :: new ( self . position ( ) ) ;
829
829
self . expn_data_shorthands . insert ( expn_id, pos) ;
830
- expn_data. encode ( self )
830
+ ( expn_data, transparency ) . encode ( self )
831
831
}
832
832
}
833
833
}
0 commit comments