Skip to content

Commit 220e45d

Browse files
committed
Remove new uses of const ty feeding
1 parent b9a1e52 commit 220e45d

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
454454
hir::AssocItemConstraintKind::Equality { term } => {
455455
let term = match term {
456456
hir::Term::Ty(ty) => self.lower_ty(ty).into(),
457-
hir::Term::Const(ct) => {
458-
ty::Const::from_const_arg(tcx, ct, assoc_item.def_id).into()
459-
}
457+
hir::Term::Const(ct) => ty::Const::from_const_arg_without_feeding(tcx, ct).into(),
460458
};
461459

462460
// Find any late-bound regions declared in `ty` that are not

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)