Skip to content
New issue

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

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

Already on GitHub? # to your account

Document unaligned reference restrictions #1326

Open
ehuss opened this issue Feb 1, 2023 · 2 comments
Open

Document unaligned reference restrictions #1326

ehuss opened this issue Feb 1, 2023 · 2 comments

Comments

@ehuss
Copy link
Contributor

ehuss commented Feb 1, 2023

cc rust-lang/rust#102513

@dtolnay
Copy link
Member

dtolnay commented Feb 5, 2023

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

@ehuss
Copy link
Contributor Author

ehuss commented Jun 27, 2023

#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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants