@@ -91,14 +91,14 @@ fn compare_predicate_entailment<'tcx>(
9191
9292 // This code is best explained by example. Consider a trait:
9393 //
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;
9696 // }
9797 //
9898 // And an impl:
9999 //
100100 // 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;
102102 // }
103103 //
104104 // We wish to decide if those two method types are compatible.
@@ -116,9 +116,9 @@ fn compare_predicate_entailment<'tcx>(
116116 // regions (Note: but only early-bound regions, i.e., those
117117 // declared on the impl or used in type parameter bounds).
118118 //
119- // impl_to_skol_substs = {'i => 'i0, U => U0, N => N0 }
119+ // impl_to_placeholder_substs = {'i => 'i0, U => U0, N => N0 }
120120 //
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
122122 // to yield a new function type in terms of our fresh, placeholder
123123 // types:
124124 //
@@ -127,11 +127,11 @@ fn compare_predicate_entailment<'tcx>(
127127 // We now want to extract and substitute the type of the *trait*
128128 // method and compare it. To do so, we must create a compound
129129 // 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
131131 // type parameters. We extend the mapping to also include
132132 // the method parameters.
133133 //
134- // trait_to_skol_substs = { T => &'i0 U0, Self => Foo, M => N0 }
134+ // trait_to_placeholder_substs = { T => &'i0 U0, Self => Foo, M => N0 }
135135 //
136136 // Applying this to the trait method type yields:
137137 //
@@ -145,20 +145,20 @@ fn compare_predicate_entailment<'tcx>(
145145 // satisfied by the implementation's method.
146146 //
147147 // 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
150150 // in the trait_m.generics to the placeholder form.
151151 //
152152 // Finally we register each of these predicates as an obligation in
153153 // a fresh FulfillmentCtxt, and invoke select_all_or_error.
154154
155155 // 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 ) ;
157157
158158 // 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 ) ;
162162
163163 let impl_m_generics = tcx. generics_of ( impl_m. def_id ) ;
164164 let trait_m_generics = tcx. generics_of ( trait_m. def_id ) ;
@@ -194,7 +194,7 @@ fn compare_predicate_entailment<'tcx>(
194194 // if all constraints hold.
195195 hybrid_preds
196196 . 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 ) ;
198198
199199 // Construct trait parameter environment and then shift it into the placeholder viewpoint.
200200 // The key step here is to update the caller_bounds's predicates to be
@@ -220,7 +220,7 @@ fn compare_predicate_entailment<'tcx>(
220220
221221 let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
222222
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 ) ;
224224 let ( impl_m_own_bounds, _) = infcx. replace_bound_vars_with_fresh_vars (
225225 impl_m_span,
226226 infer:: HigherRankedType ,
@@ -261,7 +261,7 @@ fn compare_predicate_entailment<'tcx>(
261261 debug ! ( "compare_impl_method: impl_fty={:?}" , impl_fty) ;
262262
263263 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 ) ;
265265 let trait_sig =
266266 inh. normalize_associated_types_in ( impl_m_span, impl_m_hir_id, param_env, & trait_sig) ;
267267 let trait_fty = tcx. mk_fn_ptr ( ty:: Binder :: bind ( trait_sig) ) ;
0 commit comments