@@ -1032,7 +1032,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1032
1032
self . trait_defines_associated_item_named ( r. def_id ( ) , assoc_kind, assoc_name)
1033
1033
} ) ;
1034
1034
1035
- let Some ( mut bound) = matching_candidates. next ( ) else {
1035
+ let Some ( bound) = matching_candidates. next ( ) else {
1036
1036
let reported = self . complain_about_assoc_item_not_found (
1037
1037
all_candidates,
1038
1038
& ty_param_name. to_string ( ) ,
@@ -1046,38 +1046,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1046
1046
} ;
1047
1047
debug ! ( ?bound) ;
1048
1048
1049
- // look for a candidate that is not the same as our first bound, disregarding
1050
- // whether the bound is const.
1051
- let mut next_cand = matching_candidates. next ( ) ;
1052
- while let Some ( mut bound2) = next_cand {
1053
- debug ! ( ?bound2) ;
1054
- if bound2. bound_vars ( ) != bound. bound_vars ( ) {
1055
- break ;
1056
- }
1057
-
1058
- let generics = tcx. generics_of ( bound. def_id ( ) ) ;
1059
- let Some ( host_index) = generics. host_effect_index else { break } ;
1060
-
1061
- // always return the bound that contains the host param.
1062
- if let ty:: ConstKind :: Param ( _) = bound2. skip_binder ( ) . args . const_at ( host_index) . kind ( ) {
1063
- ( bound, bound2) = ( bound2, bound) ;
1064
- }
1065
-
1066
- let unconsted_args = bound
1067
- . skip_binder ( )
1068
- . args
1069
- . iter ( )
1070
- . enumerate ( )
1071
- . map ( |( n, arg) | if host_index == n { tcx. consts . true_ . into ( ) } else { arg } ) ;
1072
-
1073
- if unconsted_args. eq ( bound2. skip_binder ( ) . args . iter ( ) ) {
1074
- next_cand = matching_candidates. next ( ) ;
1075
- } else {
1076
- break ;
1077
- }
1078
- }
1079
-
1080
- if let Some ( bound2) = next_cand {
1049
+ if let Some ( bound2) = matching_candidates. next ( ) {
1081
1050
debug ! ( ?bound2) ;
1082
1051
1083
1052
let assoc_kind_str = assoc_kind_str ( assoc_kind) ;
0 commit comments