@@ -914,14 +914,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
914914 let mut where_bounds = vec ! [ ] ;
915915 for bound in [ bound, bound2] . into_iter ( ) . chain ( matching_candidates) {
916916 let bound_id = bound. def_id ( ) ;
917- let assoc_item = tcx
917+ let bound_span = tcx
918918 . associated_items ( bound_id)
919- . find_by_name_and_kind ( tcx, assoc_name, assoc_kind, bound_id) ;
920- let bound_span = assoc_item . and_then ( |item| tcx. hir ( ) . span_if_local ( item. def_id ) ) ;
919+ . find_by_name_and_kind ( tcx, assoc_name, assoc_kind, bound_id)
920+ . and_then ( |item| tcx. hir ( ) . span_if_local ( item. def_id ) ) ;
921921
922- if let Some ( assoc_item) = assoc_item
923- && let Some ( bound_span) = bound_span
924- {
922+ if let Some ( bound_span) = bound_span {
925923 err. span_label (
926924 bound_span,
927925 format ! ( "ambiguous `{assoc_name}` from `{}`" , bound. print_trait_sugared( ) , ) ,
@@ -932,7 +930,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
932930 let term: ty:: Term < ' _ > = match term {
933931 hir:: Term :: Ty ( ty) => self . lower_ty ( ty) . into ( ) ,
934932 hir:: Term :: Const ( ct) => {
935- ty:: Const :: from_const_arg ( tcx, ct, assoc_item . def_id ) . into ( )
933+ ty:: Const :: from_const_arg_without_feeding ( tcx, ct) . into ( )
936934 }
937935 } ;
938936 // FIXME(#97583): This isn't syntactically well-formed!
0 commit comments