@@ -147,7 +147,6 @@ pub struct InferCtxtInner<'tcx> {
147147 /// that might instantiate a general type variable have an order,
148148 /// represented by its upper and lower bounds.
149149 type_variables : type_variable:: TypeVariableStorage < ' tcx > ,
150- undo_log : Logs < ' tcx > ,
151150
152151 /// Map from const parameter variable to the kind of const it represents.
153152 const_unification_table : ut:: UnificationStorage < ty:: ConstVid < ' tcx > > ,
@@ -197,14 +196,16 @@ pub struct InferCtxtInner<'tcx> {
197196 /// obligations within. This is expected to be done 'late enough'
198197 /// that all type inference variables have been bound and so forth.
199198 region_obligations : Vec < ( hir:: HirId , RegionObligation < ' tcx > ) > ,
199+
200+ undo_log : InferCtxtUndoLogs < ' tcx > ,
200201}
201202
202203impl < ' tcx > InferCtxtInner < ' tcx > {
203204 fn new ( ) -> InferCtxtInner < ' tcx > {
204205 InferCtxtInner {
205206 projection_cache : Default :: default ( ) ,
206207 type_variables : type_variable:: TypeVariableStorage :: new ( ) ,
207- undo_log : Logs :: default ( ) ,
208+ undo_log : InferCtxtUndoLogs :: default ( ) ,
208209 const_unification_table : ut:: UnificationStorage :: new ( ) ,
209210 int_unification_table : ut:: UnificationStorage :: new ( ) ,
210211 float_unification_table : ut:: UnificationStorage :: new ( ) ,
@@ -228,15 +229,23 @@ impl<'tcx> InferCtxtInner<'tcx> {
228229 fn int_unification_table (
229230 & mut self ,
230231 ) -> ut:: UnificationTable <
231- ut:: InPlace < ty:: IntVid , & mut ut:: UnificationStorage < ty:: IntVid > , & mut Logs < ' tcx > > ,
232+ ut:: InPlace <
233+ ty:: IntVid ,
234+ & mut ut:: UnificationStorage < ty:: IntVid > ,
235+ & mut InferCtxtUndoLogs < ' tcx > ,
236+ > ,
232237 > {
233238 ut:: UnificationTable :: with_log ( & mut self . int_unification_table , & mut self . undo_log )
234239 }
235240
236241 fn float_unification_table (
237242 & mut self ,
238243 ) -> ut:: UnificationTable <
239- ut:: InPlace < ty:: FloatVid , & mut ut:: UnificationStorage < ty:: FloatVid > , & mut Logs < ' tcx > > ,
244+ ut:: InPlace <
245+ ty:: FloatVid ,
246+ & mut ut:: UnificationStorage < ty:: FloatVid > ,
247+ & mut InferCtxtUndoLogs < ' tcx > ,
248+ > ,
240249 > {
241250 ut:: UnificationTable :: with_log ( & mut self . float_unification_table , & mut self . undo_log )
242251 }
@@ -247,7 +256,7 @@ impl<'tcx> InferCtxtInner<'tcx> {
247256 ut:: InPlace <
248257 ty:: ConstVid < ' tcx > ,
249258 & mut ut:: UnificationStorage < ty:: ConstVid < ' tcx > > ,
250- & mut Logs < ' tcx > ,
259+ & mut InferCtxtUndoLogs < ' tcx > ,
251260 > ,
252261 > {
253262 ut:: UnificationTable :: with_log ( & mut self . const_unification_table , & mut self . undo_log )
@@ -343,8 +352,9 @@ impl<'tcx> From<traits::UndoLog<'tcx>> for UndoLog<'tcx> {
343352 }
344353}
345354
346- pub ( crate ) type UnificationTable < ' a , ' tcx , T > =
347- ut:: UnificationTable < ut:: InPlace < T , & ' a mut ut:: UnificationStorage < T > , & ' a mut Logs < ' tcx > > > ;
355+ pub ( crate ) type UnificationTable < ' a , ' tcx , T > = ut:: UnificationTable <
356+ ut:: InPlace < T , & ' a mut ut:: UnificationStorage < T > , & ' a mut InferCtxtUndoLogs < ' tcx > > ,
357+ > ;
348358
349359struct RollbackView < ' tcx , ' a > {
350360 type_variables : & ' a mut type_variable:: TypeVariableStorage < ' tcx > ,
@@ -375,18 +385,18 @@ impl<'tcx> Rollback<UndoLog<'tcx>> for RollbackView<'tcx, '_> {
375385 }
376386}
377387
378- pub ( crate ) struct Logs < ' tcx > {
388+ pub ( crate ) struct InferCtxtUndoLogs < ' tcx > {
379389 logs : Vec < UndoLog < ' tcx > > ,
380390 num_open_snapshots : usize ,
381391}
382392
383- impl Default for Logs < ' _ > {
393+ impl Default for InferCtxtUndoLogs < ' _ > {
384394 fn default ( ) -> Self {
385395 Self { logs : Default :: default ( ) , num_open_snapshots : Default :: default ( ) }
386396 }
387397}
388398
389- impl < ' tcx , T > UndoLogs < T > for Logs < ' tcx >
399+ impl < ' tcx , T > UndoLogs < T > for InferCtxtUndoLogs < ' tcx >
390400where
391401 UndoLog < ' tcx > : From < T > ,
392402{
@@ -413,7 +423,7 @@ where
413423 }
414424}
415425
416- impl < ' tcx > Snapshots < UndoLog < ' tcx > > for Logs < ' tcx > {
426+ impl < ' tcx > Snapshots < UndoLog < ' tcx > > for InferCtxtUndoLogs < ' tcx > {
417427 type Snapshot = Snapshot < ' tcx > ;
418428 fn actions_since_snapshot ( & self , snapshot : & Self :: Snapshot ) -> & [ UndoLog < ' tcx > ] {
419429 & self . logs [ snapshot. undo_len ..]
@@ -464,7 +474,7 @@ impl<'tcx> Snapshots<UndoLog<'tcx>> for Logs<'tcx> {
464474 }
465475}
466476
467- impl < ' tcx > Logs < ' tcx > {
477+ impl < ' tcx > InferCtxtUndoLogs < ' tcx > {
468478 pub ( crate ) fn region_constraints (
469479 & self ,
470480 after : usize ,
0 commit comments