Skip to content

Commit 1454bab

Browse files
committed
Remove new uses of const ty feeding
1 parent ef05a08 commit 1454bab

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
@@ -452,9 +452,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
452452
hir::AssocItemConstraintKind::Equality { term } => {
453453
let term = match term {
454454
hir::Term::Ty(ty) => self.lower_ty(ty).into(),
455-
hir::Term::Const(ct) => {
456-
ty::Const::from_const_arg(tcx, ct, assoc_item.def_id).into()
457-
}
455+
hir::Term::Const(ct) => ty::Const::from_const_arg_without_feeding(tcx, ct).into(),
458456
};
459457

460458
// 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
@@ -899,14 +899,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
899899
let mut where_bounds = vec![];
900900
for bound in [bound, bound2].into_iter().chain(matching_candidates) {
901901
let bound_id = bound.def_id();
902-
let assoc_item = tcx
902+
let bound_span = tcx
903903
.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));
906906

907-
if let Some(assoc_item) = assoc_item
908-
&& let Some(bound_span) = bound_span
909-
{
907+
if let Some(bound_span) = bound_span {
910908
err.span_label(
911909
bound_span,
912910
format!("ambiguous `{assoc_name}` from `{}`", bound.print_trait_sugared(),),
@@ -917,7 +915,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
917915
let term: ty::Term<'_> = match term {
918916
hir::Term::Ty(ty) => self.lower_ty(ty).into(),
919917
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()
921919
}
922920
};
923921
// FIXME(#97583): This isn't syntactically well-formed!

0 commit comments

Comments
 (0)