about summary refs log tree commit diff
path: root/tests/rustdoc-ui/coverage/enum-tuple-documented.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-31 14:30:43 +0100
committerGitHub <noreply@github.com>2024-12-31 14:30:43 +0100
commit852440ba5fddd950dd09728bd621f5a13683f101 (patch)
tree41e2af7ab58d5382ea4271f65b4e979bae7ecf5e /tests/rustdoc-ui/coverage/enum-tuple-documented.rs
parentd08d13252483d76b6a9d54459659cfca84cbdfe3 (diff)
parentd9ef419c90fff3797e8069979272c51c547119bb (diff)
downloadrust-852440ba5fddd950dd09728bd621f5a13683f101.tar.gz
rust-852440ba5fddd950dd09728bd621f5a13683f101.zip
Rollup merge of #134953 - DiuDiu777:unaligned-doc, r=RalfJung
Fix doc for read&write unaligned in zst operation

### PR Description
This PR addresses an inconsistency in the Rust documentation regarding `read_unaligned ` and `write_unaligned` on zero-sized types (ZSTs). The current documentation for [pointer validity](https://doc.rust-lang.org/nightly/std/ptr/index.html#safety) states that for zero-sized types (ZSTs), null pointers are valid:
> For zero-sized types (ZSTs), every pointer is valid, including the null pointer.

However, there is an inconsistency in the documentation for the unaligned read operation in the function [ptr::read_unaligned](https://doc.rust-lang.org/nightly/std/ptr/fn.read_unaligned.html)(as well as `write_unaligned`), which states:
> Note that even if T has size 0, the pointer must be non-null.

This change is also supported by [PR #134912](https://github.com/rust-lang/rust/pull/134912)
> the _unaligned method docs should be fixed.
Diffstat (limited to 'tests/rustdoc-ui/coverage/enum-tuple-documented.rs')
0 files changed, 0 insertions, 0 deletions