Allow single-field named structs to be transparent - #3971
Merged
Conversation
This more closely matches the criteria for e.g. #[repr(transparent)] and #[serde(transparent)].
abonander
requested changes
Aug 18, 2025
abonander
left a comment
Collaborator
There was a problem hiding this comment.
Looks fine with a couple of nits + docs and testing.
Tests (Where should those go? The change isn't backend-specific)
Preferably you should add a test for each backend to be sure the behavior is consistent. But if you don't have the time for that, I'd say just pick one:
Xiretza
force-pushed
the
transparent-named-structs
branch
4 times, most recently
from
August 19, 2025 16:18
c0ae489 to
2eb8165
Compare
abonander
requested changes
Aug 19, 2025
Xiretza
force-pushed
the
transparent-named-structs
branch
5 times, most recently
from
August 20, 2025 20:12
53d62c3 to
985d526
Compare
Xiretza
force-pushed
the
transparent-named-structs
branch
from
August 20, 2025 20:17
985d526 to
d125276
Compare
Collaborator
|
Thanks! |
willothy
pushed a commit
to freestyle-sh/sqlx
that referenced
this pull request
Dec 5, 2025
* Allow single-field named structs to be transparent This more closely matches the criteria for e.g. #[repr(transparent)] and #[serde(transparent)]. * Add tests, fix error messages
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 more closely matches the criteria for e.g.
#[repr(transparent)]and#[serde(transparent)].TODO, if this is deemed a desirable change:
Does your PR solve an issue?
Couldn't find an issue filed already.
Is this a breaking change?
No, code that previously compiled is unchanged, only code that used to be a compile error now does compile.