@@ -914,14 +914,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
914
914
let mut where_bounds = vec ! [ ] ;
915
915
for bound in [ bound, bound2] . into_iter ( ) . chain ( matching_candidates) {
916
916
let bound_id = bound. def_id ( ) ;
917
- let assoc_item = tcx
917
+ let bound_span = tcx
918
918
. 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 ) ) ;
921
921
922
- if let Some ( assoc_item) = assoc_item
923
- && let Some ( bound_span) = bound_span
924
- {
922
+ if let Some ( bound_span) = bound_span {
925
923
err. span_label (
926
924
bound_span,
927
925
format ! ( "ambiguous `{assoc_name}` from `{}`" , bound. print_trait_sugared( ) , ) ,
@@ -932,7 +930,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
932
930
let term: ty:: Term < ' _ > = match term {
933
931
hir:: Term :: Ty ( ty) => self . lower_ty ( ty) . into ( ) ,
934
932
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 ( )
936
934
}
937
935
} ;
938
936
// FIXME(#97583): This isn't syntactically well-formed!
0 commit comments