Repository navigation
fix: Panic in async closures with HRTB - #23409
Merged
Merged
Conversation
Previously, generating SCIP on the `dolang-org/dolang` GitHub
repository would panic with:
panicked at crates/hir-ty/src/next_solver/infer/region_constraints/mod.rs:448:17:
cannot relate bound region: '^1 <= ReLateParam(FunctionId("run"), 1)
When rust-analyzer has debug assertions enabled, we'd get a different
panic:
ra-ap-rustc_type_ir-0.166.0/src/relate/combine.rs:57:5:
assertion failed: !a.has_escaping_bound_vars()
Ensure that we don't have escaping bound vars by using the
.liberate_late_bound_regions() helper rather than just calling
.skip_binder(). This matches what rustc does:
https://github.com/rust-lang/rust/blob/a92214c92df8cc0261f5ab5c08c6376c2c03a958/compiler/rustc_hir_typeck/src/closure.rs#L251
AI disclosure: Code partly written by GPT-5 Sol, commit message and
review by me.
ChayimFriedman2
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, generating SCIP on the
dolang-org/dolangGitHub repository would panic with:When rust-analyzer has debug assertions enabled, we'd get a different panic:
Ensure that we don't have escaping bound vars by using the .liberate_late_bound_regions() helper rather than just calling .skip_binder(). This matches what rustc does:
https://github.com/rust-lang/rust/blob/a92214c92df8cc0261f5ab5c08c6376c2c03a958/compiler/rustc_hir_typeck/src/closure.rs#L251
AI disclosure: Code partly written by GPT-5 Sol, commit message and review by me.