fix: don't panic on a qualified path whose trait is not a trait - #22930
Merged
ChayimFriedman2 merged 1 commit intoJul 28, 2026
Conversation
ChayimFriedman2
requested changes
Jul 27, 2026
shulaoda
force-pushed
the
07-27-fix_don_t_panic_on_a_qualified_path_whose_trait_is_not_a_trait
branch
from
July 28, 2026 00:20
37130d9 to
94af7e7
Compare
Collaborator
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
ChayimFriedman2
approved these changes
Jul 28, 2026
ChayimFriedman2
enabled auto-merge
July 28, 2026 00:24
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.
Closes #22799
<S as S>::SwhereSis a struct panics withthe only possible situation here is incorrect lifetime order, even though there are no lifetimes anywhere.check_generic_args_len()skips the self type unconditionally, but the loop that consumes the arguments only skips it when the def has aSelfparameter. A struct has none, so the self type is left over, matched against a regular parameter, and trips an assertion that assumes any leftover argument is a misordered lifetime. Skipping it in the loop as well keeps the two in agreement.This only stops the panic. rustc reports
E0404: expected trait, found struct, and there is no handler for it underide-diagnostics/src/handlers/, so we still say nothing about the path itself.🤖 AI-assisted: understanding the issue, locating the cause, and writing the test.