1
Fork 0

Rollup merge of #136806 - adwinwhite:cycle-in-pretty-print-rpitit, r=compiler-errors

Fix cycle when debug-printing opaque types from RPITIT

Extend #66594 to opaque types from RPITIT.

Before this PR, enabling debug logging like `RUSTC_LOG="[check_type_bounds]"` for code containing RPITIT produces a query cycle of `explicit_item_bounds`, as pretty printing for opaque type calls [it](d9a4a47b8b/compiler/rustc_middle/src/ty/print/pretty.rs (L1001)).
This commit is contained in:
Jacob Pratt 2025-02-12 20:09:59 -05:00 committed by GitHub
commit 03e2d7ebc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,6 +30,7 @@ fn associated_type_bounds<'tcx>(
span: Span, span: Span,
filter: PredicateFilter, filter: PredicateFilter,
) -> &'tcx [(ty::Clause<'tcx>, Span)] { ) -> &'tcx [(ty::Clause<'tcx>, Span)] {
ty::print::with_reduced_queries!({
let item_ty = Ty::new_projection_from_args( let item_ty = Ty::new_projection_from_args(
tcx, tcx,
assoc_item_def_id.to_def_id(), assoc_item_def_id.to_def_id(),
@ -77,6 +78,7 @@ fn associated_type_bounds<'tcx>(
assert_only_contains_predicates_from(filter, all_bounds, item_ty); assert_only_contains_predicates_from(filter, all_bounds, item_ty);
all_bounds all_bounds
})
} }
/// The code below is quite involved, so let me explain. /// The code below is quite involved, so let me explain.