You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add valid examples to std::ptr::{read,write}_unaligned #62357
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
The fix for this bug thus is to add an example like this, and a similar one for writes, to the docs for read_unaligned and write_unaligned. The docs should also explain why using just read or write is UB.
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Activity
RalfJung commentedon Jul 4, 2019
Slices are one context in which one could conceivably create an unaligned raw pointer:
Thanks to @Shnatsel on Zulip.
The fix for this bug thus is to add an example like this, and a similar one for writes, to the docs for
read_unalignedandwrite_unaligned. The docs should also explain why using justreadorwriteis UB.Freyskeyd commentedon Jul 8, 2019
Hello!
I would like to work on this one :)
Freyskeyd commentedon Jul 8, 2019
@rustbot claim
Rollup merge of rust-lang#62493 - Freyskeyd:valid_example_read-write_…
Auto merge of #62561 - Centril:rollup-5pxj3bo, r=Centril
Auto merge of #62561 - Centril:rollup-5pxj3bo, r=Centril
RalfJung commentedon Jul 13, 2019
Fixed by #62493.