Normalize raw derive attributes - #3624
Conversation
Rust accepts raw identifier spellings for representation attributes, but the derive parser compared their token spelling literally. As a result, it could ignore compiler-applied layout constraints and emit unsafe trait impls for the wrong layout. Normalize raw identifiers when matching attributes and representation hints, including Zerocopy helper attributes. Add parser-level and end-to-end tests for IntoBytes, TryFromBytes, and KnownLayout behavior. Closes #3620 *Authored by an AI agent acting on Josh Liebow-Feeser's behalf.* gherrit-pr-id: Gzghu5ypldjnatumvxfh6zygvwuqht3av
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3624 +/- ##
=======================================
Coverage 91.85% 91.85%
=======================================
Files 20 20
Lines 6093 6093
=======================================
Hits 5597 5597
Misses 496 496 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Rust accepts raw identifier spellings for representation attributes, but the
derive parser compared their token spelling literally. As a result, it could
ignore compiler-applied layout constraints and emit unsafe trait impls for the
wrong layout.
Normalize raw identifiers when matching attributes and representation hints,
including Zerocopy helper attributes. Add parser-level and end-to-end tests for
IntoBytes, TryFromBytes, and KnownLayout behavior.
Closes #3620
Authored by an AI agent acting on Josh Liebow-Feeser's behalf.
Latest Update: v2 — Compare vs v1
📚 Full Patch History
Links show the diff between the row version and the column version.
⬇️ Download this PR
Branch
git fetch origin refs/heads/Gzghu5ypldjnatumvxfh6zygvwuqht3av && git checkout -b pr-Gzghu5ypldjnatumvxfh6zygvwuqht3av FETCH_HEADCheckout
git fetch origin refs/heads/Gzghu5ypldjnatumvxfh6zygvwuqht3av && git checkout FETCH_HEADCherry Pick
git fetch origin refs/heads/Gzghu5ypldjnatumvxfh6zygvwuqht3av && git cherry-pick FETCH_HEADPull
Stacked PRs enabled by GHerrit.