internal: add missing where clause to projection types#121
Merged
nbdd0121 merged 1 commit intoRust-for-Linux:mainfrom Apr 23, 2026
Merged
internal: add missing where clause to projection types#121nbdd0121 merged 1 commit intoRust-for-Linux:mainfrom
nbdd0121 merged 1 commit intoRust-for-Linux:mainfrom
Conversation
cc86c47 to
8b0f7c0
Compare
nbdd0121
previously approved these changes
Apr 23, 2026
`#[pin_data]` failed to propagate the struct's `where` clause to the generated projection struct. As a result, bounds written in a `where` clause could be dropped during expansion, causing type errors when fields depended on those bounds. Fix this by adding the missing `where` clause to the generated projection struct. Link: https://rust-for-linux.zulipchat.com/#narrow/channel/561532-pin-init/topic/generic.20bounds.20and.20.60.23.5Bpin_data.5D.60/with/578381591 Reported-by: Andreas Hindborg <a.hindborg@kernel.org> Signed-off-by: Mohamad Alsadhan <mo@sdhn.cc> [ Trimmed commit message, removed feature gates in tests no longer necessary after MSRV bump. - Gary ] Signed-off-by: Gary Guo <gary@garyguo.net>
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.
#[pin_data]failed to propagate the struct'swhereclause to the generated projection struct. As a result, bounds written in awhereclause could be dropped during expansion, causing type errors when fields depended on those bounds.Fix this by adding the missing
whereclause to the generated projection struct.Add a regression test covering
#[pin_data]withwhere-clause bounds.Bless expand tests (only
many_generics.rs) that became outdated.Link: https://rust-for-linux.zulipchat.com/#narrow/channel/561532-pin-init/topic/generic.20bounds.20and.20.60.23.5Bpin_data.5D.60/with/578381591
Reported-by: Andreas Hindborg a.hindborg@kernel.org