Skip to content

Document unaligned reference restrictions #1326

Description

@ehuss

Activity

  1. dtolnay commented on Feb 5, 2023

    @dtolnay
    Member

    As part of this, please also delete this outdated warning:

    <div class="warning">
    ***Warning:*** Dereferencing an unaligned pointer is [undefined behavior] and
    it is possible to [safely create unaligned pointers to `packed` fields][27060].
    Like all ways to create undefined behavior in safe Rust, this is a bug.
    </div>

    [27060]: https://github.com/rust-lang/rust/issues/27060

  2. ehuss commented on Jun 27, 2023

    @ehuss
    ContributorAuthor

    #1367 has removed the warning, but there still needs to be something added about the restriction of creating unaligned references (probably in the pointers page?). Also, I don't think "unaligned" is ever explicitly defined, which probably should be covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions