@@ -1545,7 +1545,6 @@ fn assemble_candidate_for_impl_trait_in_trait<'cx, 'tcx>(
1545
1545
let trait_def_id = tcx. parent ( trait_fn_def_id) ;
1546
1546
let trait_substs =
1547
1547
obligation. predicate . substs . truncate_to ( tcx, tcx. generics_of ( trait_def_id) ) ;
1548
- // FIXME(named-returns): Binders
1549
1548
let trait_predicate = ty:: TraitRef :: new ( tcx, trait_def_id, trait_substs) ;
1550
1549
1551
1550
let _ = selcx. infcx . commit_if_ok ( |_| {
@@ -1747,8 +1746,8 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
1747
1746
1748
1747
// If we are resolving `<T as TraitRef<...>>::Item == Type`,
1749
1748
// start out by selecting the predicate `T as TraitRef<...>`:
1750
- let poly_trait_ref = ty :: Binder :: dummy ( obligation. predicate . trait_ref ( selcx. tcx ( ) ) ) ;
1751
- let trait_obligation = obligation. with ( selcx. tcx ( ) , poly_trait_ref ) ;
1749
+ let trait_ref = obligation. predicate . trait_ref ( selcx. tcx ( ) ) ;
1750
+ let trait_obligation = obligation. with ( selcx. tcx ( ) , trait_ref ) ;
1752
1751
let _ = selcx. infcx . commit_if_ok ( |_| {
1753
1752
let impl_source = match selcx. select ( & trait_obligation) {
1754
1753
Ok ( Some ( impl_source) ) => impl_source,
@@ -1802,7 +1801,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
1802
1801
if obligation. param_env . reveal ( ) == Reveal :: All {
1803
1802
// NOTE(eddyb) inference variables can resolve to parameters, so
1804
1803
// assume `poly_trait_ref` isn't monomorphic, if it contains any.
1805
- let poly_trait_ref = selcx. infcx . resolve_vars_if_possible ( poly_trait_ref ) ;
1804
+ let poly_trait_ref = selcx. infcx . resolve_vars_if_possible ( trait_ref ) ;
1806
1805
!poly_trait_ref. still_further_specializable ( )
1807
1806
} else {
1808
1807
debug ! (
@@ -1821,11 +1820,11 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
1821
1820
let self_ty = selcx. infcx . shallow_resolve ( obligation. predicate . self_ty ( ) ) ;
1822
1821
1823
1822
let lang_items = selcx. tcx ( ) . lang_items ( ) ;
1824
- if [ lang_items. gen_trait ( ) , lang_items. future_trait ( ) ] . contains ( & Some ( poly_trait_ref . def_id ( ) ) )
1825
- || selcx. tcx ( ) . fn_trait_kind_from_def_id ( poly_trait_ref . def_id ( ) ) . is_some ( )
1823
+ if [ lang_items. gen_trait ( ) , lang_items. future_trait ( ) ] . contains ( & Some ( trait_ref . def_id ) )
1824
+ || selcx. tcx ( ) . fn_trait_kind_from_def_id ( trait_ref . def_id ) . is_some ( )
1826
1825
{
1827
1826
true
1828
- } else if lang_items. discriminant_kind_trait ( ) == Some ( poly_trait_ref . def_id ( ) ) {
1827
+ } else if lang_items. discriminant_kind_trait ( ) == Some ( trait_ref . def_id ) {
1829
1828
match self_ty. kind ( ) {
1830
1829
ty:: Bool
1831
1830
| ty:: Char
@@ -1860,7 +1859,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
1860
1859
| ty:: Infer ( ..)
1861
1860
| ty:: Error ( _) => false ,
1862
1861
}
1863
- } else if lang_items. pointee_trait ( ) == Some ( poly_trait_ref . def_id ( ) ) {
1862
+ } else if lang_items. pointee_trait ( ) == Some ( trait_ref . def_id ) {
1864
1863
let tail = selcx. tcx ( ) . struct_tail_with_normalize (
1865
1864
self_ty,
1866
1865
|ty| {
@@ -1935,7 +1934,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
1935
1934
}
1936
1935
}
1937
1936
} else {
1938
- bug ! ( "unexpected builtin trait with associated type: {poly_trait_ref :?}" )
1937
+ bug ! ( "unexpected builtin trait with associated type: {trait_ref :?}" )
1939
1938
}
1940
1939
}
1941
1940
super :: ImplSource :: Param ( ..) => {
0 commit comments