Fix struct_with_invariants generic param detection for associated type prefixes#2447
Open
rikosellic wants to merge 8 commits into
Open
Fix struct_with_invariants generic param detection for associated type prefixes#2447rikosellic wants to merge 8 commits into
struct_with_invariants generic param detection for associated type prefixes#2447rikosellic wants to merge 8 commits into
Conversation
Contributor
Author
|
It turns out the current implementation doesn't carry enough type-bound information through the macro expansion. The generated field-type aliases and |
Contributor
Author
|
The doc build error seems irrelevant. |
tjhance
requested changes
May 15, 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.
This PR fixes a bug in
struct_with_invariants!where generic type parameters are used only as an associated type prefix.Input
Output
It fails to compile with this error (playground link):
Fix
The fix updates the generic-usage collector in
struct_decl_inv.rsso it also recognizes the first segment of multi-segment type paths. A regression test is also added.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.