@@ -1748,38 +1748,37 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1748
1748
) -> Vec < PredicateObligation < ' tcx > > {
1749
1749
// Because the types were potentially derived from
1750
1750
// higher-ranked obligations they may reference late-bound
1751
- // regions. For example, `for<'a> Foo<&'a int > : Copy` would
1752
- // yield a type like `for<'a> &'a int `. In general, we
1751
+ // regions. For example, `for<'a> Foo<&'a i32 > : Copy` would
1752
+ // yield a type like `for<'a> &'a i32 `. In general, we
1753
1753
// maintain the invariant that we never manipulate bound
1754
1754
// regions, so we have to process these bound regions somehow.
1755
1755
//
1756
1756
// The strategy is to:
1757
1757
//
1758
1758
// 1. Instantiate those regions to placeholder regions (e.g.,
1759
- // `for<'a> &'a int ` becomes `&0 int `.
1760
- // 2. Produce something like `&'0 int : Copy`
1761
- // 3. Re-bind the regions back to `for<'a> &'a int : Copy`
1759
+ // `for<'a> &'a i32 ` becomes `&0 i32 `.
1760
+ // 2. Produce something like `&'0 i32 : Copy`
1761
+ // 3. Re-bind the regions back to `for<'a> &'a i32 : Copy`
1762
1762
1763
1763
types
1764
- . skip_binder ( )
1764
+ . skip_binder ( ) // binder moved -\
1765
1765
. iter ( )
1766
1766
. flat_map ( |ty| {
1767
- // binder moved -\
1768
1767
let ty: ty:: Binder < Ty < ' tcx > > = ty:: Binder :: bind ( ty) ; // <----/
1769
1768
1770
1769
self . infcx . commit_unconditionally ( |_| {
1771
- let ( skol_ty , _) = self . infcx . replace_bound_vars_with_placeholders ( & ty) ;
1770
+ let ( placeholder_ty , _) = self . infcx . replace_bound_vars_with_placeholders ( & ty) ;
1772
1771
let Normalized { value : normalized_ty, mut obligations } =
1773
1772
ensure_sufficient_stack ( || {
1774
1773
project:: normalize_with_depth (
1775
1774
self ,
1776
1775
param_env,
1777
1776
cause. clone ( ) ,
1778
1777
recursion_depth,
1779
- & skol_ty ,
1778
+ & placeholder_ty ,
1780
1779
)
1781
1780
} ) ;
1782
- let skol_obligation = predicate_for_trait_def (
1781
+ let placeholder_obligation = predicate_for_trait_def (
1783
1782
self . tcx ( ) ,
1784
1783
param_env,
1785
1784
cause. clone ( ) ,
@@ -1788,7 +1787,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1788
1787
normalized_ty,
1789
1788
& [ ] ,
1790
1789
) ;
1791
- obligations. push ( skol_obligation ) ;
1790
+ obligations. push ( placeholder_obligation ) ;
1792
1791
obligations
1793
1792
} )
1794
1793
} )
@@ -1838,9 +1837,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1838
1837
return Err ( ( ) ) ;
1839
1838
}
1840
1839
1841
- let ( skol_obligation , placeholder_map) =
1840
+ let ( placeholder_obligation , placeholder_map) =
1842
1841
self . infcx ( ) . replace_bound_vars_with_placeholders ( & obligation. predicate ) ;
1843
- let skol_obligation_trait_ref = skol_obligation . trait_ref ;
1842
+ let placeholder_obligation_trait_ref = placeholder_obligation . trait_ref ;
1844
1843
1845
1844
let impl_substs = self . infcx . fresh_substs_for_item ( obligation. cause . span , impl_def_id) ;
1846
1845
@@ -1859,14 +1858,14 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1859
1858
1860
1859
debug ! (
1861
1860
"match_impl(impl_def_id={:?}, obligation={:?}, \
1862
- impl_trait_ref={:?}, skol_obligation_trait_ref ={:?})",
1863
- impl_def_id, obligation, impl_trait_ref, skol_obligation_trait_ref
1861
+ impl_trait_ref={:?}, placeholder_obligation_trait_ref ={:?})",
1862
+ impl_def_id, obligation, impl_trait_ref, placeholder_obligation_trait_ref
1864
1863
) ;
1865
1864
1866
1865
let InferOk { obligations, .. } = self
1867
1866
. infcx
1868
1867
. at ( & obligation. cause , obligation. param_env )
1869
- . eq ( skol_obligation_trait_ref , impl_trait_ref)
1868
+ . eq ( placeholder_obligation_trait_ref , impl_trait_ref)
1870
1869
. map_err ( |e| debug ! ( "match_impl: failed eq_trait_refs due to `{}`" , e) ) ?;
1871
1870
nested_obligations. extend ( obligations) ;
1872
1871
0 commit comments