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

Document that NotNan is repr(transparent). #158

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Commits on Oct 15, 2024

  1. Document that NotNan is repr(transparent).

    Currently, rustdoc only displays `repr(transparent)` if the type’s
    fields are public, so there is no indication in the documentation that
    `NotNan` has `repr(transparent)`. Even if it was visible, there is not
    currently a strong consensus that such a repr may be assumed to be a
    stable part of the public API.
    
    Therefore, add paragraphs to `NotNan` and `OrderedFloat`’s documentation
    guaranteeing the repr. I also mentioned `bytemuck` so as to not be
    encouraging unsafe code, though the phrasing isn’t great.
    kpreid committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    4b07101 View commit details
    Browse the repository at this point in the history
  2. Add impl bytemuck::TransparentWrapper for OrderedFloat.

    This gives a more strongly-typed way for users to take advantage of
    `OrderedFloat`’s representation.
    kpreid committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    7abdbc9 View commit details
    Browse the repository at this point in the history