@@ -70,7 +70,7 @@ use rustc_middle::ty::{
7070 self ,
7171 error:: TypeError ,
7272 subst:: { GenericArgKind , Subst , SubstsRef } ,
73- Binder , List , Region , Ty , TyCtxt , TypeFoldable ,
73+ Binder , EarlyBinder , List , Region , Ty , TyCtxt , TypeFoldable ,
7474} ;
7575use rustc_span:: { sym, BytePos , DesugaringKind , Pos , Span } ;
7676use rustc_target:: spec:: abi;
@@ -961,12 +961,14 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
961961 for ( def_id, actual) in iter:: zip ( default_params, substs. iter ( ) . rev ( ) ) {
962962 match actual. unpack ( ) {
963963 GenericArgKind :: Const ( c) => {
964- if self . tcx . const_param_default ( def_id) . subst ( self . tcx , substs) != c {
964+ if EarlyBinder ( self . tcx . const_param_default ( def_id) ) . subst ( self . tcx , substs)
965+ != c
966+ {
965967 break ;
966968 }
967969 }
968970 GenericArgKind :: Type ( ty) => {
969- if self . tcx . type_of ( def_id) . subst ( self . tcx , substs) != ty {
971+ if self . tcx . bound_type_of ( def_id) . subst ( self . tcx , substs) != ty {
970972 break ;
971973 }
972974 }
@@ -1383,8 +1385,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13831385 }
13841386
13851387 ( ty:: FnDef ( did1, substs1) , ty:: FnDef ( did2, substs2) ) => {
1386- let sig1 = self . tcx . fn_sig ( * did1) . subst ( self . tcx , substs1) ;
1387- let sig2 = self . tcx . fn_sig ( * did2) . subst ( self . tcx , substs2) ;
1388+ let sig1 = self . tcx . bound_fn_sig ( * did1) . subst ( self . tcx , substs1) ;
1389+ let sig2 = self . tcx . bound_fn_sig ( * did2) . subst ( self . tcx , substs2) ;
13881390 let mut values = self . cmp_fn_sig ( & sig1, & sig2) ;
13891391 let path1 = format ! ( " {{{}}}" , self . tcx. def_path_str_with_substs( * did1, substs1) ) ;
13901392 let path2 = format ! ( " {{{}}}" , self . tcx. def_path_str_with_substs( * did2, substs2) ) ;
@@ -1395,7 +1397,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13951397 }
13961398
13971399 ( ty:: FnDef ( did1, substs1) , ty:: FnPtr ( sig2) ) => {
1398- let sig1 = self . tcx . fn_sig ( * did1) . subst ( self . tcx , substs1) ;
1400+ let sig1 = self . tcx . bound_fn_sig ( * did1) . subst ( self . tcx , substs1) ;
13991401 let mut values = self . cmp_fn_sig ( & sig1, sig2) ;
14001402 values. 0 . push_highlighted ( format ! (
14011403 " {{{}}}" ,
@@ -1405,7 +1407,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14051407 }
14061408
14071409 ( ty:: FnPtr ( sig1) , ty:: FnDef ( did2, substs2) ) => {
1408- let sig2 = self . tcx . fn_sig ( * did2) . subst ( self . tcx , substs2) ;
1410+ let sig2 = self . tcx . bound_fn_sig ( * did2) . subst ( self . tcx , substs2) ;
14091411 let mut values = self . cmp_fn_sig ( sig1, & sig2) ;
14101412 values. 1 . push_normal ( format ! (
14111413 " {{{}}}" ,
@@ -1847,9 +1849,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
18471849 // Future::Output
18481850 let item_def_id = self . tcx . associated_item_def_ids ( future_trait) [ 0 ] ;
18491851
1850- let bounds = self . tcx . explicit_item_bounds ( * def_id) ;
1852+ let bounds = self . tcx . bound_explicit_item_bounds ( * def_id) ;
18511853
1852- for ( predicate, _) in bounds {
1854+ for predicate in bounds . transpose_iter ( ) . map ( |e| e . map_bound ( | ( p , _) | * p ) ) {
18531855 let predicate = predicate. subst ( self . tcx , substs) ;
18541856 let output = predicate
18551857 . kind ( )
0 commit comments