Allow single-field named structs to be transparent#3971
Merged
abonander merged 2 commits intolaunchbadge:mainfrom Aug 21, 2025
Merged
Allow single-field named structs to be transparent#3971abonander merged 2 commits intolaunchbadge:mainfrom
abonander merged 2 commits intolaunchbadge:mainfrom
Conversation
This more closely matches the criteria for e.g. #[repr(transparent)] and #[serde(transparent)].
abonander
requested changes
Aug 18, 2025
Collaborator
abonander
left a comment
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:
c0ae489 to
2eb8165
Compare
abonander
requested changes
Aug 19, 2025
53d62c3 to
985d526
Compare
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.