fix: avoid panic for mismatched opaque type parameters - #23211
Open
YUZHEthefool wants to merge 1 commit into
Open
fix: avoid panic for mismatched opaque type parameters#23211YUZHEthefool wants to merge 1 commit into
YUZHEthefool wants to merge 1 commit into
Conversation
ChayimFriedman2
requested changes
Aug 21, 2026
Contributor
There was a problem hiding this comment.
That's now how rustc does things. See https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_trait_selection/opaque_types.rs.html#66-126.
Contributor
Author
|
Maybe I need move the check to the |
YUZHEthefool
force-pushed
the
fix/opaque-type-parameter-panic
branch
from
August 21, 2026 17:24
4dbe9c3 to
05c0f73
Compare
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.
Because the closure type in the generic method
foo<T>will carry two parameters [S, T], but the associated opaque type E only allows the use of [S].So I add a new function to check when instantiating a hidden type, check whether the type, const, lifetime parameters referenced by it exist and the types match.
And record opaque errors for illegal ATIT generic input to avoid passing incompatible parameters to the binder.
Fix: #23124