Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Nov 22, 2025

Updates safety comments to cite specific stable Rust documentation versions (1.81.0) instead of stable/nightly. Adds quotes from the docs. Resolves FIXMEs for NonZero layout, Option<NonZero>, and null pointer representation.

Closes #1655


PR created automatically by Jules for task 6771150785289939532 started by @joshlf

Updates safety comments in `src/impls.rs`, `src/util/mod.rs`,
`src/lib.rs`, `src/pointer/ptr.rs`, and `zerocopy-derive/src/enum.rs`
to cite specific stable Rust versions (mainly 1.81.0) instead of
generic `stable` or `nightly` URLs.

Adds quotes from the documentation to support the safety claims,
as per the issue requirements.

Resolves FIXMEs related to missing citations for `NonZero` layout,
`Option<NonZero>` compatibility, and `null` pointer representation.

Closes #1655
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.14%. Comparing base (cd0dcd0) to head (6bdd7f4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2800   +/-   ##
=======================================
  Coverage   88.14%   88.14%           
=======================================
  Files          20       20           
  Lines        5450     5450           
=======================================
  Hits         4804     4804           
  Misses        646      646           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Updates safety comments in `src/impls.rs`, `src/util/mod.rs`,
`src/lib.rs`, `src/pointer/ptr.rs`, and `zerocopy-derive/src/enum.rs`
to cite specific stable Rust versions (mainly 1.81.0) instead of
generic `stable` or `nightly` URLs.

Adds quotes from the documentation to support the safety claims,
as per the issue requirements.

Resolves FIXMEs related to missing citations for `NonZero` layout,
`Option<NonZero>` compatibility, and `null` pointer representation.

Clarifies safety comment in `src/pointer/ptr.rs` regarding validity
preservation when iterating over slices.

Closes #1655
Corrects the URLs for `NonZeroU8` and `NonZeroI8` documentation
to point to `type.NonZero*.html` instead of `struct.NonZero*.html`,
as they are type aliases in Rust 1.81.0.

Ensures quoted text regarding layout and Option compatibility is accurate.
joshlf
joshlf previously requested changes Nov 22, 2025
@joshlf joshlf marked this pull request as ready for review November 22, 2025 17:43
@joshlf
Copy link
Member

joshlf commented Nov 22, 2025

LGTM, but I want @jswrenn to take a look as well.

@joshlf joshlf requested a review from jswrenn November 22, 2025 17:44
@joshlf joshlf enabled auto-merge November 22, 2025 17:44
@google-labs-jules
Copy link
Contributor Author

LGTM, but I want @jswrenn to take a look as well.

Acknowledged.

Adds the documentation quote "Thanks to the null pointer optimization,
NonZero... and Option<NonZero...> are guaranteed to have the same size
and alignment" to the safety comments for `Option<NonZeroU8>` and
`Option<NonZeroI8>`.
@joshlf joshlf dismissed their stale review November 24, 2025 21:09

Dismissing my own review

@joshlf joshlf added this pull request to the merge queue Nov 24, 2025
Merged via the queue into main with commit 16d065d Nov 24, 2025
98 checks passed
@joshlf joshlf deleted the fix-safety-citations-1655 branch November 24, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure all safety comments quote and cite a specific version of the documentation

3 participants