@@ -18,7 +18,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
18
18
/// from `&[u32; 3]` to `&[u32]` and make the users life more
19
19
/// pleasant.
20
20
///
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
22
22
/// routine actually does is to start a snapshot and execute the
23
23
/// closure `f`. In our example above, what this closure will do
24
24
/// is to unify the expectation (`Option<&[u32]>`) with the actual
@@ -27,7 +27,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
27
27
/// with `&?a [u32]`, where `?a` is a fresh lifetime variable. The
28
28
/// input type (`?T`) is then returned by `f()`.
29
29
///
30
- /// At this point, `fudge_regions_if_ok ` will normalize all type
30
+ /// At this point, `fudge_inference_if_ok ` will normalize all type
31
31
/// variables, converting `?T` to `&?a [u32]` and end the
32
32
/// snapshot. The problem is that we can't just return this type
33
33
/// out, because it references the region variable `?a`, and that
@@ -46,15 +46,15 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
46
46
/// the actual types (`?T`, `Option<?T>`) -- and remember that
47
47
/// after the snapshot is popped, the variable `?T` is no longer
48
48
/// unified.
49
- pub fn fudge_regions_if_ok < T , E , F > (
49
+ pub fn fudge_inference_if_ok < T , E , F > (
50
50
& self ,
51
51
origin : & RegionVariableOrigin ,
52
52
f : F ,
53
53
) -> Result < T , E > where
54
54
F : FnOnce ( ) -> Result < T , E > ,
55
55
T : TypeFoldable < ' tcx > ,
56
56
{
57
- debug ! ( "fudge_regions_if_ok (origin={:?})" , origin) ;
57
+ debug ! ( "fudge_inference_if_ok (origin={:?})" , origin) ;
58
58
59
59
let ( type_variables, region_vars, value) = self . probe ( |snapshot| {
60
60
match f ( ) {
@@ -91,7 +91,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
91
91
return Ok ( value) ;
92
92
}
93
93
94
- let mut fudger = RegionFudger {
94
+ let mut fudger = InferenceFudger {
95
95
infcx : self ,
96
96
type_variables : & type_variables,
97
97
region_vars : & region_vars,
@@ -102,14 +102,14 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
102
102
}
103
103
}
104
104
105
- pub struct RegionFudger < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
105
+ pub struct InferenceFudger < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
106
106
infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > ,
107
107
type_variables : & ' a Range < TyVid > ,
108
108
region_vars : & ' a Range < RegionVid > ,
109
109
origin : & ' a RegionVariableOrigin ,
110
110
}
111
111
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 > {
113
113
fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > {
114
114
self . infcx . tcx
115
115
}
0 commit comments