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 for NonZeroXxx types #620

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Nov 15, 2023

Makes progress on #429

@joshlf joshlf marked this pull request as ready for review November 15, 2023 22:20
@joshlf joshlf requested a review from jswrenn November 15, 2023 22:20
@joshlf joshlf force-pushed the nonzero-safety-docs branch from 932bea7 to 78d252c Compare November 15, 2023 22:29
Comment on lines +1835 to +1836
/// `NonZeroXxx` has the same layout and bit validity as its associated
/// primitive with the exception that 0 is not a valid instance. [1]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also cite documentation that primitive number types are represented in two's complement? In principle, the value 0u8 in a programming language does not necessarily need to be represented as 0b0000_0000, but that's exactly what matters here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't actually find where this is documented (e.g. of u16 or i16). Are you able to find any documentation for it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Bump. Are you comfortable just merging as-is?

@joshlf joshlf requested a review from jswrenn January 18, 2024 23:42
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.

2 participants