@@ -347,7 +347,7 @@ pub(crate) type UnificationTable<'a, 'tcx, T> =
347347 ut:: UnificationTable < ut:: InPlace < T , & ' a mut ut:: UnificationStorage < T > , & ' a mut Logs < ' tcx > > > ;
348348
349349struct RollbackView < ' tcx , ' a > {
350- type_variables : type_variable:: RollbackView < ' tcx , ' a > ,
350+ type_variables : & ' a mut type_variable:: TypeVariableStorage < ' tcx > ,
351351 const_unification_table : & ' a mut ut:: UnificationStorage < ty:: ConstVid < ' tcx > > ,
352352 int_unification_table : & ' a mut ut:: UnificationStorage < ty:: IntVid > ,
353353 float_unification_table : & ' a mut ut:: UnificationStorage < ty:: FloatVid > ,
@@ -420,7 +420,8 @@ impl<'tcx> Snapshots<UndoLog<'tcx>> for Logs<'tcx> {
420420 }
421421
422422 fn start_snapshot ( & mut self ) -> Self :: Snapshot {
423- unreachable ! ( )
423+ self . num_open_snapshots += 1 ;
424+ Snapshot { undo_len : self . logs . len ( ) , _marker : PhantomData }
424425 }
425426
426427 fn rollback_to < R > ( & mut self , values : impl FnOnce ( ) -> R , snapshot : Self :: Snapshot )
@@ -1056,10 +1057,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10561057
10571058 let mut inner = self . inner . borrow_mut ( ) ;
10581059
1059- inner. undo_log . num_open_snapshots += 1 ;
1060- let undo_snapshot = Snapshot { undo_len : inner. undo_log . logs . len ( ) , _marker : PhantomData } ;
10611060 CombinedSnapshot {
1062- undo_snapshot,
1061+ undo_snapshot : inner . undo_log . start_snapshot ( ) ,
10631062 universe : self . universe ( ) ,
10641063 was_in_snapshot : in_snapshot,
10651064 // Borrow tables "in progress" (i.e., during typeck)
@@ -1089,7 +1088,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10891088 } = & mut * self . inner . borrow_mut ( ) ;
10901089 undo_log. rollback_to (
10911090 || RollbackView {
1092- type_variables : type_variable :: RollbackView :: from ( type_variables ) ,
1091+ type_variables,
10931092 const_unification_table,
10941093 int_unification_table,
10951094 float_unification_table,
0 commit comments