@@ -918,7 +918,6 @@ pub struct CombinedSnapshot<'a, 'tcx> {
918
918
region_obligations_snapshot : usize ,
919
919
universe : ty:: UniverseIndex ,
920
920
was_in_snapshot : bool ,
921
- was_skip_leak_check : bool ,
922
921
_in_progress_tables : Option < Ref < ' a , ty:: TypeckTables < ' tcx > > > ,
923
922
}
924
923
@@ -1056,7 +1055,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1056
1055
region_obligations_snapshot : inner. region_obligations . len ( ) ,
1057
1056
universe : self . universe ( ) ,
1058
1057
was_in_snapshot : in_snapshot,
1059
- was_skip_leak_check : self . skip_leak_check . get ( ) ,
1060
1058
// Borrow tables "in progress" (i.e., during typeck)
1061
1059
// to ban writes from within a snapshot to them.
1062
1060
_in_progress_tables : self . in_progress_tables . map ( |tables| tables. borrow ( ) ) ,
@@ -1070,13 +1068,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1070
1068
region_obligations_snapshot,
1071
1069
universe,
1072
1070
was_in_snapshot,
1073
- was_skip_leak_check,
1074
1071
_in_progress_tables,
1075
1072
} = snapshot;
1076
1073
1077
1074
self . in_snapshot . set ( was_in_snapshot) ;
1078
1075
self . universe . set ( universe) ;
1079
- self . skip_leak_check . set ( was_skip_leak_check) ;
1080
1076
1081
1077
let InferCtxtInner {
1082
1078
type_variables,
@@ -1110,12 +1106,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1110
1106
region_obligations_snapshot : _,
1111
1107
universe : _,
1112
1108
was_in_snapshot,
1113
- was_skip_leak_check,
1114
1109
_in_progress_tables,
1115
1110
} = snapshot;
1116
1111
1117
1112
self . in_snapshot . set ( was_in_snapshot) ;
1118
- self . skip_leak_check . set ( was_skip_leak_check) ;
1119
1113
1120
1114
let mut inner = self . inner . borrow_mut ( ) ;
1121
1115
inner. undo_log . commit ( undo_snapshot) ;
@@ -1183,10 +1177,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1183
1177
{
1184
1178
debug ! ( "probe()" ) ;
1185
1179
let snapshot = self . start_snapshot ( ) ;
1186
- let skip_leak_check = should_skip || self . skip_leak_check . get ( ) ;
1187
- self . skip_leak_check . set ( skip_leak_check) ;
1180
+ let was_skip_leak_check = self . skip_leak_check . get ( ) ;
1181
+ if should_skip {
1182
+ self . skip_leak_check . set ( true ) ;
1183
+ }
1188
1184
let r = f ( & snapshot) ;
1189
1185
self . rollback_to ( "probe" , snapshot) ;
1186
+ self . skip_leak_check . set ( was_skip_leak_check) ;
1190
1187
r
1191
1188
}
1192
1189
0 commit comments