Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update safety comments to cite specific versions #1835

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

varun-doshi
Copy link
Contributor

Related issue #1655

Copy link

google-cla bot commented Oct 7, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.40%. Comparing base (1271aa0) to head (02727cd).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1835   +/-   ##
=======================================
  Coverage   87.40%   87.40%           
=======================================
  Files          16       16           
  Lines        5995     5995           
=======================================
  Hits         5240     5240           
  Misses        755      755           

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

jswrenn
jswrenn previously requested changes Oct 7, 2024
Copy link
Collaborator

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! There's one link you missed. Could you also run ./cargo.sh +stable fmt?

src/impls.rs Outdated
/// [1] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroU8.html
/// `NonZeroU8 is guaranteed to have the same layout and bit validity as u8 with
/// the exception that 0 is not a valid instance`
/// [2] https://doc.rust-lang.org/stable/std/num/type.NonZeroI8.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// [2] https://doc.rust-lang.org/stable/std/num/type.NonZeroI8.html
/// [2] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroI8.html

Copy link
Member

@joshlf joshlf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! One small nit.

src/impls.rs Outdated
Comment on lines 267 to 272
/// [1] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroU8.html
/// `NonZeroU8 is guaranteed to have the same layout and bit validity as u8 with
/// the exception that 0 is not a valid instance`
/// [2] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroI8.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// [1] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroU8.html
/// `NonZeroU8 is guaranteed to have the same layout and bit validity as u8 with
/// the exception that 0 is not a valid instance`
/// [2] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroI8.html
/// [1] Per https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroU8.html:
///
/// `NonZeroU8` is guaranteed to have the same layout and bit validity as `u8` with
/// the exception that 0 is not a valid instance
///
/// [2] https://doc.rust-lang.org/1.81.0/std/num/type.NonZeroI8.html

The backticks are used around code items like NonZeroU8 or u8, not around the entire quote. Also, add a newline before (and in the case where there's another citation afterward, a newline after as well).

Update Reference and docs links in safety comments to reference specific
versions of the Rust toolchain.

Makes progress on google#1655
@joshlf joshlf changed the title feat: safety comments updated Update safety comments to cite specific versions Oct 7, 2024
@joshlf joshlf enabled auto-merge October 7, 2024 22:22
@joshlf joshlf dismissed jswrenn’s stale review October 7, 2024 22:23

jswrenn's comments were addressed

@joshlf joshlf added this pull request to the merge queue Oct 7, 2024
Merged via the queue into google:main with commit 0475310 Oct 7, 2024
87 checks passed
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.

4 participants