Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis 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 #3930 +/- ##
=======================================
Coverage 92.99% 92.99%
=======================================
Files 16 16
Lines 2469 2469
=======================================
Hits 2296 2296
Misses 173 173 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11156a43f3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
11156a4 to
74294e7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74294e768a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
In Unicode 18 (picked up by rustc in rust-lang/rust#165289 starting in nightly-2026-11-18), UTS #39 reclassified `ẕ` (U+1E95) from `IdentifierType::Recommended` to `IdentifierType::Uncommon_Use`. Because `derive_projection_struct_union` constructed `enum ẕ<field> {}` with `ident.span()`, rustc recorded the identifier under the caller's span and emitted `uncommon_codepoints` warnings (and rejected crates with `#![deny(non_ascii_idents)]`; neither lint can be suppressed at item scope because `uncommon_codepoints` and `non_ascii_idents` are `crate_level_only`). Additionally, using a fixed marker prefix without checking `DeriveInput` allowed a colliding generic type parameter on `Self` to shadow the generated private marker enum inside `HasField` and `ProjectField`, substituting the caller-chosen type argument as `Field` and exposing private fields to external safe `Ptr::project` callers. Replace `ẕ` with a fresh ASCII prefix (`ctx.fresh_prefix("___ZcField_")`) at `Span::mixed_site()`, scope each field's marker enum to its own `const` block, and freshen `___ZcAliasing` and `___ZcAlignment` in `project.rs` via `ctx.fresh_ident`. Compute fresh suffixes in a single linear pass over input tokens, and mix in a deterministic 128-bit token hash whenever `DeriveInput` contains `!` as a best-effort collision mitigation when unexpanded macros are present (complete item-namespace isolation of non-`pub` markers from replayed type-position macros is not possible on stable Rust MSRV 1.56 without unstable `Span::def_site()`, because `E0446` rejects projecting private field types through a `pub` helper trait on a `pub` `Self` without a non-`pub` type in the `impl` header, `fn`-local derives preclude `super::` module escapes, and output must remain deterministic for reproducible builds). Add unit, snapshot, integration, and MSRV/stable/nightly UI regression tests covering identifier lints (`uncommon_codepoints`, `non_ascii_idents`, `confusable_idents`, `mixed_script_confusables`), outer-type and self-name collisions, unexpanded type-macro collisions, linear-time long underscore runs, cascading generic-parameter collisions, and private-field encapsulation. Closes #2880 Closes #3929 gherrit-pr-id: G2v47f6fsyy7ghpeb7rdbrpvrk3esc4u6 Agent-authored-by: AI agent acting on joshlf's behalf
74294e7 to
362ae27
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
In Unicode 18 (picked up by rustc in rust-lang/rust#165289 starting in
nightly-2026-11-18), UTS #39 reclassified
ẕ(U+1E95) fromIdentifierType::RecommendedtoIdentifierType::Uncommon_Use. Becausederive_projection_struct_unionconstructedenum ẕ<field> {}withident.span(), rustc recorded the identifier under the caller's span andemitted
uncommon_codepointswarnings (and rejected crates with#![deny(non_ascii_idents)]; neither lint can be suppressed at itemscope because
uncommon_codepointsandnon_ascii_identsarecrate_level_only).Additionally, using a fixed marker prefix without checking
DeriveInputallowed a colliding generic type parameter on
Selfto shadow thegenerated private marker enum inside
HasFieldandProjectField,substituting the caller-chosen type argument as
Fieldand exposingprivate fields to external safe
Ptr::projectcallers.Replace
ẕwith a fresh ASCII prefix (ctx.fresh_prefix("___ZcField_"))at
Span::mixed_site(), scope each field's marker enum to its ownconstblock, and freshen___ZcAliasingand___ZcAlignmentinproject.rsviactx.fresh_ident. Compute fresh suffixes in a singlelinear pass over input tokens, and mix in a deterministic 128-bit token
hash whenever
DeriveInputcontains!as a best-effort collisionmitigation when unexpanded macros are present (complete item-namespace
isolation of non-
pubmarkers from replayed type-position macros is notpossible on stable Rust MSRV 1.56 without unstable
Span::def_site(),because
E0446rejects projecting private field types through apubhelper trait on a
pubSelfwithout a non-pubtype in theimplheader,
fn-local derives precludesuper::module escapes, and outputmust remain deterministic for reproducible builds).
Add unit, snapshot, integration, and MSRV/stable/nightly UI regression
tests covering identifier lints (
uncommon_codepoints,non_ascii_idents,confusable_idents,mixed_script_confusables),outer-type and self-name collisions, unexpanded type-macro collisions,
linear-time long underscore runs, cascading generic-parameter collisions,
and private-field encapsulation.
Closes #2880
Closes #3929
Agent-authored-by: AI agent acting on joshlf's behalf
___ZcField_prefix for field markers #3930Latest Update: v3 — Compare vs v2
📚 Full Patch History
Links show the diff between the row version and the column version.
⬇️ Download this PR
Branch
git fetch origin refs/heads/G2v47f6fsyy7ghpeb7rdbrpvrk3esc4u6 && git checkout -b pr-G2v47f6fsyy7ghpeb7rdbrpvrk3esc4u6 FETCH_HEADCheckout
git fetch origin refs/heads/G2v47f6fsyy7ghpeb7rdbrpvrk3esc4u6 && git checkout FETCH_HEADCherry Pick
git fetch origin refs/heads/G2v47f6fsyy7ghpeb7rdbrpvrk3esc4u6 && git cherry-pick FETCH_HEADPull
Stacked PRs enabled by GHerrit.