@@ -347,7 +347,7 @@ pub(crate) type UnificationTable<'a, 'tcx, T> =
347
347
ut:: UnificationTable < ut:: InPlace < T , & ' a mut ut:: UnificationStorage < T > , & ' a mut Logs < ' tcx > > > ;
348
348
349
349
struct RollbackView < ' tcx , ' a > {
350
- type_variables : type_variable:: RollbackView < ' tcx , ' a > ,
350
+ type_variables : & ' a mut type_variable:: TypeVariableStorage < ' tcx > ,
351
351
const_unification_table : & ' a mut ut:: UnificationStorage < ty:: ConstVid < ' tcx > > ,
352
352
int_unification_table : & ' a mut ut:: UnificationStorage < ty:: IntVid > ,
353
353
float_unification_table : & ' a mut ut:: UnificationStorage < ty:: FloatVid > ,
@@ -420,7 +420,8 @@ impl<'tcx> Snapshots<UndoLog<'tcx>> for Logs<'tcx> {
420
420
}
421
421
422
422
fn start_snapshot ( & mut self ) -> Self :: Snapshot {
423
- unreachable ! ( )
423
+ self . num_open_snapshots += 1 ;
424
+ Snapshot { undo_len : self . logs . len ( ) , _marker : PhantomData }
424
425
}
425
426
426
427
fn rollback_to < R > ( & mut self , values : impl FnOnce ( ) -> R , snapshot : Self :: Snapshot )
@@ -1056,10 +1057,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1056
1057
1057
1058
let mut inner = self . inner . borrow_mut ( ) ;
1058
1059
1059
- inner. undo_log . num_open_snapshots += 1 ;
1060
- let undo_snapshot = Snapshot { undo_len : inner. undo_log . logs . len ( ) , _marker : PhantomData } ;
1061
1060
CombinedSnapshot {
1062
- undo_snapshot,
1061
+ undo_snapshot : inner . undo_log . start_snapshot ( ) ,
1063
1062
universe : self . universe ( ) ,
1064
1063
was_in_snapshot : in_snapshot,
1065
1064
// Borrow tables "in progress" (i.e., during typeck)
@@ -1089,7 +1088,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1089
1088
} = & mut * self . inner . borrow_mut ( ) ;
1090
1089
undo_log. rollback_to (
1091
1090
|| RollbackView {
1092
- type_variables : type_variable :: RollbackView :: from ( type_variables ) ,
1091
+ type_variables,
1093
1092
const_unification_table,
1094
1093
int_unification_table,
1095
1094
float_unification_table,
0 commit comments