@@ -899,14 +899,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
899
899
let mut where_bounds = vec ! [ ] ;
900
900
for bound in [ bound, bound2] . into_iter ( ) . chain ( matching_candidates) {
901
901
let bound_id = bound. def_id ( ) ;
902
- let assoc_item = tcx
902
+ let bound_span = tcx
903
903
. associated_items ( bound_id)
904
- . find_by_name_and_kind ( tcx, assoc_name, assoc_kind, bound_id) ;
905
- let bound_span = assoc_item . and_then ( |item| tcx. hir ( ) . span_if_local ( item. def_id ) ) ;
904
+ . find_by_name_and_kind ( tcx, assoc_name, assoc_kind, bound_id)
905
+ . and_then ( |item| tcx. hir ( ) . span_if_local ( item. def_id ) ) ;
906
906
907
- if let Some ( assoc_item) = assoc_item
908
- && let Some ( bound_span) = bound_span
909
- {
907
+ if let Some ( bound_span) = bound_span {
910
908
err. span_label (
911
909
bound_span,
912
910
format ! ( "ambiguous `{assoc_name}` from `{}`" , bound. print_trait_sugared( ) , ) ,
@@ -917,7 +915,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
917
915
let term: ty:: Term < ' _ > = match term {
918
916
hir:: Term :: Ty ( ty) => self . lower_ty ( ty) . into ( ) ,
919
917
hir:: Term :: Const ( ct) => {
920
- ty:: Const :: from_const_arg ( tcx, ct, assoc_item . def_id ) . into ( )
918
+ ty:: Const :: from_const_arg_without_feeding ( tcx, ct) . into ( )
921
919
}
922
920
} ;
923
921
// FIXME(#97583): This isn't syntactically well-formed!
0 commit comments