@@ -91,14 +91,14 @@ fn compare_predicate_entailment<'tcx>(
91
91
92
92
// This code is best explained by example. Consider a trait:
93
93
//
94
- // trait Trait<'t,T> {
95
- // fn method<'a,M>(t: &'t T, m: &'a M) -> Self;
94
+ // trait Trait<'t, T> {
95
+ // fn method<'a, M>(t: &'t T, m: &'a M) -> Self;
96
96
// }
97
97
//
98
98
// And an impl:
99
99
//
100
100
// impl<'i, 'j, U> Trait<'j, &'i U> for Foo {
101
- // fn method<'b,N>(t: &'j &'i U, m: &'b N) -> Foo;
101
+ // fn method<'b, N>(t: &'j &'i U, m: &'b N) -> Foo;
102
102
// }
103
103
//
104
104
// We wish to decide if those two method types are compatible.
@@ -116,9 +116,9 @@ fn compare_predicate_entailment<'tcx>(
116
116
// regions (Note: but only early-bound regions, i.e., those
117
117
// declared on the impl or used in type parameter bounds).
118
118
//
119
- // impl_to_skol_substs = {'i => 'i0, U => U0, N => N0 }
119
+ // impl_to_placeholder_substs = {'i => 'i0, U => U0, N => N0 }
120
120
//
121
- // Now we can apply skol_substs to the type of the impl method
121
+ // Now we can apply placeholder_substs to the type of the impl method
122
122
// to yield a new function type in terms of our fresh, placeholder
123
123
// types:
124
124
//
@@ -127,11 +127,11 @@ fn compare_predicate_entailment<'tcx>(
127
127
// We now want to extract and substitute the type of the *trait*
128
128
// method and compare it. To do so, we must create a compound
129
129
// substitution by combining trait_to_impl_substs and
130
- // impl_to_skol_substs , and also adding a mapping for the method
130
+ // impl_to_placeholder_substs , and also adding a mapping for the method
131
131
// type parameters. We extend the mapping to also include
132
132
// the method parameters.
133
133
//
134
- // trait_to_skol_substs = { T => &'i0 U0, Self => Foo, M => N0 }
134
+ // trait_to_placeholder_substs = { T => &'i0 U0, Self => Foo, M => N0 }
135
135
//
136
136
// Applying this to the trait method type yields:
137
137
//
@@ -145,20 +145,20 @@ fn compare_predicate_entailment<'tcx>(
145
145
// satisfied by the implementation's method.
146
146
//
147
147
// We do this by creating a parameter environment which contains a
148
- // substitution corresponding to impl_to_skol_substs . We then build
149
- // trait_to_skol_substs and use it to convert the predicates contained
148
+ // substitution corresponding to impl_to_placeholder_substs . We then build
149
+ // trait_to_placeholder_substs and use it to convert the predicates contained
150
150
// in the trait_m.generics to the placeholder form.
151
151
//
152
152
// Finally we register each of these predicates as an obligation in
153
153
// a fresh FulfillmentCtxt, and invoke select_all_or_error.
154
154
155
155
// Create mapping from impl to placeholder.
156
- let impl_to_skol_substs = InternalSubsts :: identity_for_item ( tcx, impl_m. def_id ) ;
156
+ let impl_to_placeholder_substs = InternalSubsts :: identity_for_item ( tcx, impl_m. def_id ) ;
157
157
158
158
// Create mapping from trait to placeholder.
159
- let trait_to_skol_substs =
160
- impl_to_skol_substs . rebase_onto ( tcx, impl_m. container . id ( ) , trait_to_impl_substs) ;
161
- debug ! ( "compare_impl_method: trait_to_skol_substs ={:?}" , trait_to_skol_substs ) ;
159
+ let trait_to_placeholder_substs =
160
+ impl_to_placeholder_substs . rebase_onto ( tcx, impl_m. container . id ( ) , trait_to_impl_substs) ;
161
+ debug ! ( "compare_impl_method: trait_to_placeholder_substs ={:?}" , trait_to_placeholder_substs ) ;
162
162
163
163
let impl_m_generics = tcx. generics_of ( impl_m. def_id ) ;
164
164
let trait_m_generics = tcx. generics_of ( trait_m. def_id ) ;
@@ -194,7 +194,7 @@ fn compare_predicate_entailment<'tcx>(
194
194
// if all constraints hold.
195
195
hybrid_preds
196
196
. predicates
197
- . extend ( trait_m_predicates. instantiate_own ( tcx, trait_to_skol_substs ) . predicates ) ;
197
+ . extend ( trait_m_predicates. instantiate_own ( tcx, trait_to_placeholder_substs ) . predicates ) ;
198
198
199
199
// Construct trait parameter environment and then shift it into the placeholder viewpoint.
200
200
// The key step here is to update the caller_bounds's predicates to be
@@ -220,7 +220,7 @@ fn compare_predicate_entailment<'tcx>(
220
220
221
221
let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
222
222
223
- let impl_m_own_bounds = impl_m_predicates. instantiate_own ( tcx, impl_to_skol_substs ) ;
223
+ let impl_m_own_bounds = impl_m_predicates. instantiate_own ( tcx, impl_to_placeholder_substs ) ;
224
224
let ( impl_m_own_bounds, _) = infcx. replace_bound_vars_with_fresh_vars (
225
225
impl_m_span,
226
226
infer:: HigherRankedType ,
@@ -261,7 +261,7 @@ fn compare_predicate_entailment<'tcx>(
261
261
debug ! ( "compare_impl_method: impl_fty={:?}" , impl_fty) ;
262
262
263
263
let trait_sig = tcx. liberate_late_bound_regions ( impl_m. def_id , & tcx. fn_sig ( trait_m. def_id ) ) ;
264
- let trait_sig = trait_sig. subst ( tcx, trait_to_skol_substs ) ;
264
+ let trait_sig = trait_sig. subst ( tcx, trait_to_placeholder_substs ) ;
265
265
let trait_sig =
266
266
inh. normalize_associated_types_in ( impl_m_span, impl_m_hir_id, param_env, & trait_sig) ;
267
267
let trait_fty = tcx. mk_fn_ptr ( ty:: Binder :: bind ( trait_sig) ) ;
0 commit comments