Uh oh!
There was an error while loading. Please reload this page.
Fix cycle when debug-printing opaque types from RPITIT - #136806
Conversation
rustbot
commented
Feb 10, 2025
| let opaque_ty = tcx.hir_node_by_def_id(opaque_def_id.expect_local()).expect_opaque_ty(); | ||
| let bounds = | ||
| associated_type_bounds(tcx, def_id, opaque_ty.bounds, opaque_ty.span, filter); | ||
| let bounds = ty::print::with_reduced_queries!(associated_type_bounds( |
There was a problem hiding this comment.
Please push this down into whatever debug call in associated_type_bounds is actually responsible for the cycle.
There was a problem hiding this comment.
Inside associated_type_bounds, there are at least several debugging calls responsible for cycles on lowering functions.
Pushing with_reduced_queries down on them will affect other call sites that doesn't involve opaque types.
I didn't put it inside associated_type_bounds like opaque_type_boundsdoes for the same reason.
There was a problem hiding this comment.
I'd rather you copy the opaque_type_bounds call then, it doesn't really matter if other call sites are affected
40eb78f to
a634246CompareUh oh!
There was an error while loading. Please reload this page.
compiler-errors
commented
Feb 12, 2025
@bors r+ rollup |
bors
commented
Feb 12, 2025
…pitit, r=compiler-errors Fix cycle when debug-printing opaque types from RPITIT Extend rust-lang#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](https://github.com/rust-lang/rust/blob/d9a4a47b8b3dc0bdff83360cea2013200d60d49c/compiler/rustc_middle/src/ty/print/pretty.rs#L1001).
Rollup of 12 pull requests Successful merges: - rust-lang#134090 (Stabilize target_feature_11) - rust-lang#135025 (Cast allocas to default address space) - rust-lang#135841 (Reject `?Trait` bounds in various places where we unconditionally warned since 1.0) - rust-lang#136217 (Mark condition/carry bit as clobbered in C-SKY inline assembly) - rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions) - rust-lang#136806 (Fix cycle when debug-printing opaque types from RPITIT) - rust-lang#136807 (compiler: internally merge `PtxKernel` into `GpuKernel`) - rust-lang#136818 (Implement `read*_exact` for `std:io::repeat`) - rust-lang#136927 (Correctly escape hashtags when running `invalid_rust_codeblocks` lint) - rust-lang#136937 (Update books) - rust-lang#136945 (Add diagnostic item for `std::io::BufRead`) - rust-lang#136947 (Reinstate nnethercote in the review rotation.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136806 - adwinwhite:cycle-in-pretty-print-rpitit, r=compiler-errors Fix cycle when debug-printing opaque types from RPITIT Extend rust-lang#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](https://github.com/rust-lang/rust/blob/d9a4a47b8b3dc0bdff83360cea2013200d60d49c/compiler/rustc_middle/src/ty/print/pretty.rs#L1001).
Rollup of 12 pull requests Successful merges: - rust-lang#134090 (Stabilize target_feature_11) - rust-lang#135025 (Cast allocas to default address space) - rust-lang#135841 (Reject `?Trait` bounds in various places where we unconditionally warned since 1.0) - rust-lang#136217 (Mark condition/carry bit as clobbered in C-SKY inline assembly) - rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions) - rust-lang#136806 (Fix cycle when debug-printing opaque types from RPITIT) - rust-lang#136807 (compiler: internally merge `PtxKernel` into `GpuKernel`) - rust-lang#136818 (Implement `read*_exact` for `std:io::repeat`) - rust-lang#136927 (Correctly escape hashtags when running `invalid_rust_codeblocks` lint) - rust-lang#136937 (Update books) - rust-lang#136945 (Add diagnostic item for `std::io::BufRead`) - rust-lang#136947 (Reinstate nnethercote in the review rotation.) r? `@ghost` `@rustbot` modify labels: rollup
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 ofexplicit_item_bounds, as pretty printing for opaque type calls it.