@@ -167,7 +167,7 @@ pub struct InferCtxtInner<'tcx> {
167167 /// `resolve_regions_and_report_errors` is invoked, this gets set to `None`
168168 /// -- further attempts to perform unification, etc., may fail if new
169169 /// region constraints would've been added.
170- region_constraints : Option < RegionConstraintStorage < ' tcx > > ,
170+ region_constraint_storage : Option < RegionConstraintStorage < ' tcx > > ,
171171
172172 /// A set of constraints that regionck must validate. Each
173173 /// constraint has the form `T:'a`, meaning "some type `T` must
@@ -214,7 +214,7 @@ impl<'tcx> InferCtxtInner<'tcx> {
214214 const_unification_storage : ut:: UnificationTableStorage :: new ( ) ,
215215 int_unification_storage : ut:: UnificationTableStorage :: new ( ) ,
216216 float_unification_storage : ut:: UnificationTableStorage :: new ( ) ,
217- region_constraints : Some ( RegionConstraintStorage :: new ( ) ) ,
217+ region_constraint_storage : Some ( RegionConstraintStorage :: new ( ) ) ,
218218 region_obligations : vec ! [ ] ,
219219 }
220220 }
@@ -268,7 +268,7 @@ impl<'tcx> InferCtxtInner<'tcx> {
268268 }
269269
270270 pub fn unwrap_region_constraints ( & mut self ) -> RegionConstraintCollector < ' tcx , ' _ > {
271- self . region_constraints
271+ self . region_constraint_storage
272272 . as_mut ( )
273273 . expect ( "region constraints already solved" )
274274 . with_log ( & mut self . undo_log )
@@ -705,8 +705,9 @@ impl<'tcx> InferOk<'tcx, ()> {
705705 }
706706}
707707
708+ /// Extends `CombinedSnapshot` by tracking which variables were added in the snapshot
708709#[ must_use = "once you start a snapshot, you should always consume it" ]
709- pub struct FullSnapshot < ' a , ' tcx > {
710+ pub struct FudgeSnapshot < ' a , ' tcx > {
710711 snapshot : CombinedSnapshot < ' a , ' tcx > ,
711712 region_constraints_snapshot : RegionSnapshot ,
712713 type_snapshot : type_variable:: Snapshot < ' tcx > ,
@@ -830,10 +831,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
830831 result
831832 }
832833
833- fn start_full_snapshot ( & self ) -> FullSnapshot < ' a , ' tcx > {
834+ fn start_fudge_snapshot ( & self ) -> FudgeSnapshot < ' a , ' tcx > {
834835 let snapshot = self . start_snapshot ( ) ;
835836 let mut inner = self . inner . borrow_mut ( ) ;
836- FullSnapshot {
837+ FudgeSnapshot {
837838 snapshot,
838839 type_snapshot : inner. type_variables ( ) . snapshot ( ) ,
839840 const_var_len : inner. const_unification_table ( ) . len ( ) ,
@@ -925,12 +926,14 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
925926 r
926927 }
927928
928- pub fn probe_full < R , F > ( & self , f : F ) -> R
929+ /// Like `probe` but provides information about which variables were created in the snapshot,
930+ /// allowing for inference fudging
931+ pub fn probe_fudge < R , F > ( & self , f : F ) -> R
929932 where
930- F : FnOnce ( & FullSnapshot < ' a , ' tcx > ) -> R ,
933+ F : FnOnce ( & FudgeSnapshot < ' a , ' tcx > ) -> R ,
931934 {
932935 debug ! ( "probe()" ) ;
933- let snapshot = self . start_full_snapshot ( ) ;
936+ let snapshot = self . start_fudge_snapshot ( ) ;
934937 let r = f ( & snapshot) ;
935938 self . rollback_to ( "probe" , snapshot. snapshot ) ;
936939 r
@@ -1294,7 +1297,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
12941297 inner. region_obligations
12951298 ) ;
12961299 inner
1297- . region_constraints
1300+ . region_constraint_storage
12981301 . take ( )
12991302 . expect ( "regions already resolved" )
13001303 . with_log ( & mut inner. undo_log )
@@ -1362,7 +1365,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13621365 pub fn take_region_var_origins ( & self ) -> VarInfos {
13631366 let mut inner = self . inner . borrow_mut ( ) ;
13641367 let ( var_infos, data) = inner
1365- . region_constraints
1368+ . region_constraint_storage
13661369 . take ( )
13671370 . expect ( "regions already resolved" )
13681371 . with_log ( & mut inner. undo_log )
0 commit comments