-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve docs for slice::from_raw_parts #51423
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
Conversation
Picking someone from libs... r? @sfackler |
Also see #51134 where I previously changed these docs. |
src/libcore/slice/mod.rs
Outdated
/// `p` must be non-null and aligned, even for zero-length slices, as is | ||
/// required for all references. However, for zero-length slices, `p` can be | ||
/// a bogus non-dereferencable pointer such as [`NonNull::dangling()`]. | ||
/// `data` must be non-null and aligned, even for zero-length slices. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the reason or a reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "A reason" is more correct. Will fix.
@bors r+ rollup |
📌 Commit 426f06f has been approved by |
Improve docs for slice::from_raw_parts Explain why the pointer must be non-null and aligned. Cc @hsivonen
☀️ Test successful - status-appveyor, status-travis |
Explain why the pointer must be non-null and aligned.
Cc @hsivonen