@@ -482,7 +482,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
482
482
483
483
fn encode_item_type ( & mut self , def_id : DefId ) -> Lazy < Ty < ' tcx > > {
484
484
let tcx = self . tcx ;
485
- let ty = tcx. type_of ( def_id) ;
485
+ let ty = tcx. anonymize_scope_regions ( & tcx . type_of ( def_id) ) ;
486
486
debug ! ( "IsolatedEncoder::encode_item_type({:?}) => {:?}" , def_id, ty) ;
487
487
self . lazy ( & ty)
488
488
}
@@ -506,7 +506,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
506
506
discr : variant. discr ,
507
507
struct_ctor : None ,
508
508
ctor_sig : if variant. ctor_kind == CtorKind :: Fn {
509
- Some ( self . lazy ( & tcx . fn_sig ( def_id) ) )
509
+ Some ( self . encode_fn_sig ( def_id) )
510
510
} else {
511
511
None
512
512
}
@@ -633,7 +633,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
633
633
discr : variant. discr ,
634
634
struct_ctor : Some ( def_id. index ) ,
635
635
ctor_sig : if variant. ctor_kind == CtorKind :: Fn {
636
- Some ( self . lazy ( & tcx . fn_sig ( def_id) ) )
636
+ Some ( self . encode_fn_sig ( def_id) )
637
637
} else {
638
638
None
639
639
}
@@ -683,7 +683,13 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
683
683
fn encode_predicates ( & mut self , def_id : DefId ) -> Lazy < ty:: GenericPredicates < ' tcx > > {
684
684
debug ! ( "IsolatedEncoder::encode_predicates({:?})" , def_id) ;
685
685
let tcx = self . tcx ;
686
- self . lazy ( & tcx. predicates_of ( def_id) )
686
+ self . lazy ( & tcx. anonymize_scope_regions ( & tcx. predicates_of ( def_id) ) )
687
+ }
688
+
689
+ fn encode_fn_sig ( & mut self , def_id : DefId ) -> Lazy < ty:: PolyFnSig < ' tcx > > {
690
+ debug ! ( "IsolatedEncoder::encode_fn_sig({:?})" , def_id) ;
691
+ let tcx = self . tcx ;
692
+ self . lazy ( & tcx. anonymize_scope_regions ( & tcx. fn_sig ( def_id) ) )
687
693
}
688
694
689
695
fn encode_info_for_trait_item ( & mut self , def_id : DefId ) -> Entry < ' tcx > {
@@ -720,7 +726,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
720
726
FnData {
721
727
constness : hir:: Constness :: NotConst ,
722
728
arg_names,
723
- sig : self . lazy ( & tcx . fn_sig ( def_id) ) ,
729
+ sig : self . encode_fn_sig ( def_id) ,
724
730
}
725
731
} else {
726
732
bug ! ( )
@@ -776,7 +782,6 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
776
782
777
783
fn encode_info_for_impl_item ( & mut self , def_id : DefId ) -> Entry < ' tcx > {
778
784
debug ! ( "IsolatedEncoder::encode_info_for_impl_item({:?})" , def_id) ;
779
- let tcx = self . tcx ;
780
785
781
786
let node_id = self . tcx . hir . as_local_node_id ( def_id) . unwrap ( ) ;
782
787
let ast_item = self . tcx . hir . expect_impl_item ( node_id) ;
@@ -799,7 +804,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
799
804
FnData {
800
805
constness : sig. constness ,
801
806
arg_names : self . encode_fn_arg_names_for_body ( body) ,
802
- sig : self . lazy ( & tcx . fn_sig ( def_id) ) ,
807
+ sig : self . encode_fn_sig ( def_id) ,
803
808
}
804
809
} else {
805
810
bug ! ( )
@@ -917,7 +922,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
917
922
let data = FnData {
918
923
constness,
919
924
arg_names : self . encode_fn_arg_names_for_body ( body) ,
920
- sig : self . lazy ( & tcx . fn_sig ( def_id) ) ,
925
+ sig : self . encode_fn_sig ( def_id) ,
921
926
} ;
922
927
923
928
EntryKind :: Fn ( self . lazy ( & data) )
@@ -1013,7 +1018,9 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
1013
1018
unsafety : trait_def. unsafety ,
1014
1019
paren_sugar : trait_def. paren_sugar ,
1015
1020
has_default_impl : tcx. trait_has_default_impl ( def_id) ,
1016
- super_predicates : self . lazy ( & tcx. super_predicates_of ( def_id) ) ,
1021
+ super_predicates : self . lazy (
1022
+ & tcx. anonymize_scope_regions ( & tcx. super_predicates_of ( def_id) )
1023
+ ) ,
1017
1024
} ;
1018
1025
1019
1026
EntryKind :: Trait ( self . lazy ( & data) )
@@ -1215,7 +1222,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
1215
1222
1216
1223
let data = ClosureData {
1217
1224
kind : tcx. closure_kind ( def_id) ,
1218
- sig : self . lazy ( & tcx . fn_sig ( def_id) ) ,
1225
+ sig : self . encode_fn_sig ( def_id) ,
1219
1226
} ;
1220
1227
1221
1228
Entry {
@@ -1403,7 +1410,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
1403
1410
let data = FnData {
1404
1411
constness : hir:: Constness :: NotConst ,
1405
1412
arg_names : self . encode_fn_arg_names ( names) ,
1406
- sig : self . lazy ( & tcx . fn_sig ( def_id) ) ,
1413
+ sig : self . encode_fn_sig ( def_id) ,
1407
1414
} ;
1408
1415
EntryKind :: ForeignFn ( self . lazy ( & data) )
1409
1416
}
0 commit comments