-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix cycle when debug-printing opaque types from RPITIT #136806
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix cycle when debug-printing opaque types from RPITIT #136806
Conversation
@@ -367,8 +367,13 @@ pub(super) fn explicit_item_bounds_with_filter( | |||
// a projection self type. | |||
Some(ty::ImplTraitInTraitData::Trait { opaque_def_id, .. }) => { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_bounds
does for the same reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather you copy the opaque_type_bounds call then, it doesn't really matter if other call sites are affected
associated types
40eb78f
to
a634246
Compare
@bors r+ rollup |
…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.