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