@@ -18,7 +18,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1818 /// from `&[u32; 3]` to `&[u32]` and make the users life more
1919 /// pleasant.
2020 ///
21- /// The way we do this is using `fudge_regions_if_ok `. What the
21+ /// The way we do this is using `fudge_inference_if_ok `. What the
2222 /// routine actually does is to start a snapshot and execute the
2323 /// closure `f`. In our example above, what this closure will do
2424 /// is to unify the expectation (`Option<&[u32]>`) with the actual
@@ -27,7 +27,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
2727 /// with `&?a [u32]`, where `?a` is a fresh lifetime variable. The
2828 /// input type (`?T`) is then returned by `f()`.
2929 ///
30- /// At this point, `fudge_regions_if_ok ` will normalize all type
30+ /// At this point, `fudge_inference_if_ok ` will normalize all type
3131 /// variables, converting `?T` to `&?a [u32]` and end the
3232 /// snapshot. The problem is that we can't just return this type
3333 /// out, because it references the region variable `?a`, and that
@@ -46,15 +46,15 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
4646 /// the actual types (`?T`, `Option<?T>`) -- and remember that
4747 /// after the snapshot is popped, the variable `?T` is no longer
4848 /// unified.
49- pub fn fudge_regions_if_ok < T , E , F > (
49+ pub fn fudge_inference_if_ok < T , E , F > (
5050 & self ,
5151 origin : & RegionVariableOrigin ,
5252 f : F ,
5353 ) -> Result < T , E > where
5454 F : FnOnce ( ) -> Result < T , E > ,
5555 T : TypeFoldable < ' tcx > ,
5656 {
57- debug ! ( "fudge_regions_if_ok (origin={:?})" , origin) ;
57+ debug ! ( "fudge_inference_if_ok (origin={:?})" , origin) ;
5858
5959 let ( type_variables, region_vars, value) = self . probe ( |snapshot| {
6060 match f ( ) {
@@ -91,7 +91,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
9191 return Ok ( value) ;
9292 }
9393
94- let mut fudger = RegionFudger {
94+ let mut fudger = InferenceFudger {
9595 infcx : self ,
9696 type_variables : & type_variables,
9797 region_vars : & region_vars,
@@ -102,14 +102,14 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
102102 }
103103}
104104
105- pub struct RegionFudger < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
105+ pub struct InferenceFudger < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
106106 infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > ,
107107 type_variables : & ' a Range < TyVid > ,
108108 region_vars : & ' a Range < RegionVid > ,
109109 origin : & ' a RegionVariableOrigin ,
110110}
111111
112- impl < ' a , ' gcx , ' tcx > TypeFolder < ' gcx , ' tcx > for RegionFudger < ' a , ' gcx , ' tcx > {
112+ impl < ' a , ' gcx , ' tcx > TypeFolder < ' gcx , ' tcx > for InferenceFudger < ' a , ' gcx , ' tcx > {
113113 fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > {
114114 self . infcx . tcx
115115 }
0 commit comments