Skip to content

Commit 4cd4eae

Browse files
committed
rename skolemized to placeholder
1 parent a96510d commit 4cd4eae

File tree

29 files changed

+226
-211
lines changed

29 files changed

+226
-211
lines changed

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ for ty::RegionKind {
131131
}
132132
ty::ReLateBound(..) |
133133
ty::ReVar(..) |
134-
ty::ReSkolemized(..) => {
134+
ty::RePlaceholder(..) => {
135135
bug!("StableHasher: unexpected region {:?}", *self)
136136
}
137137
}

src/librustc/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
224224
ty::ReEarlyBound(..)
225225
| ty::ReFree(_)
226226
| ty::ReScope(_)
227-
| ty::ReSkolemized(..)
227+
| ty::RePlaceholder(..)
228228
| ty::ReEmpty
229229
| ty::ReErased => {
230230
if self.canonicalize_region_mode.other_free_regions {

src/librustc/infer/combine.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,10 @@ impl<'cx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> for Generalizer<'cx, 'gcx, '
458458
return Ok(r);
459459
}
460460

461-
// Always make a fresh region variable for skolemized regions;
462-
// the higher-ranked decision procedures rely on this.
463-
ty::ReSkolemized(..) => { }
461+
// Always make a fresh region variable for placeholder
462+
// regions; the higher-ranked decision procedures rely on
463+
// this.
464+
ty::RePlaceholder(..) => { }
464465

465466
// For anything else, we make a region variable, unless we
466467
// are *equating*, in which case it's just wasteful.

src/librustc/infer/error_reporting/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
142142

143143
ty::ReEmpty => ("the empty lifetime".to_owned(), None),
144144

145-
// FIXME(#13998) ReSkolemized should probably print like
145+
// FIXME(#13998) RePlaceholder should probably print like
146146
// ReFree rather than dumping Debug output on the user.
147147
//
148148
// We shouldn't really be having unification failures with ReVar
149149
// and ReLateBound though.
150-
ty::ReSkolemized(..) | ty::ReVar(_) | ty::ReLateBound(..) | ty::ReErased => {
150+
ty::RePlaceholder(..) | ty::ReVar(_) | ty::ReLateBound(..) | ty::ReErased => {
151151
(format!("lifetime {:?}", region), None)
152152
}
153153

src/librustc/infer/freshen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx> {
107107
ty::ReFree(_) |
108108
ty::ReScope(_) |
109109
ty::ReVar(_) |
110-
ty::ReSkolemized(..) |
110+
ty::RePlaceholder(..) |
111111
ty::ReEmpty |
112112
ty::ReErased => {
113113
// replace all free regions with 'erased

src/librustc/infer/higher_ranked/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ the same lifetime, but not the reverse.
7272
Here is the algorithm we use to perform the subtyping check:
7373

7474
1. Replace all bound regions in the subtype with new variables
75-
2. Replace all bound regions in the supertype with skolemized
76-
equivalents. A "skolemized" region is just a new fresh region
75+
2. Replace all bound regions in the supertype with placeholder
76+
equivalents. A "placeholder" region is just a new fresh region
7777
name.
7878
3. Check that the parameter and return types match as normal
79-
4. Ensure that no skolemized regions 'leak' into region variables
79+
4. Ensure that no placeholder regions 'leak' into region variables
8080
visible from "the outside"
8181

8282
Let's walk through some examples and see how this algorithm plays out.
@@ -95,7 +95,7 @@ like so:
9595
Here the upper case `&A` indicates a *region variable*, that is, a
9696
region whose value is being inferred by the system. I also replaced
9797
`&b` with `&x`---I'll use letters late in the alphabet (`x`, `y`, `z`)
98-
to indicate skolemized region names. We can assume they don't appear
98+
to indicate placeholder region names. We can assume they don't appear
9999
elsewhere. Note that neither the sub- nor the supertype bind any
100100
region names anymore (as indicated by the absence of `<` and `>`).
101101

@@ -181,15 +181,15 @@ the first example, you had two functions:
181181
for<'a> fn(&'a T) <: for<'b> fn(&'b T)
182182

183183
and hence `&A` and `&x` were created "together". In general, the
184-
intention of the skolemized names is that they are supposed to be
184+
intention of the placeholder names is that they are supposed to be
185185
fresh names that could never be equal to anything from the outside.
186186
But when inference comes into play, we might not be respecting this
187187
rule.
188188

189189
So the way we solve this is to add a fourth step that examines the
190-
constraints that refer to skolemized names. Basically, consider a
190+
constraints that refer to placeholder names. Basically, consider a
191191
non-directed version of the constraint graph. Let `Tainted(x)` be the
192-
set of all things reachable from a skolemized variable `x`.
192+
set of all things reachable from a placeholder variable `x`.
193193
`Tainted(x)` should not contain any regions that existed before the
194194
step at which the skolemization was performed. So this case here
195195
would fail because `&x` was created alone, but is relatable to `&A`.

0 commit comments

Comments
 (0)