Skip to content

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

Merged
merged 2 commits into from
Jun 11, 2018
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jun 7, 2018

Explain why the pointer must be non-null and aligned.

Cc @hsivonen

@pietroalbini
Copy link
Member

Picking someone from libs... r? @sfackler

@pietroalbini pietroalbini added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jun 7, 2018
@RalfJung
Copy link
Member Author

RalfJung commented Jun 7, 2018

Also see #51134 where I previously changed these docs.

/// `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
Copy link
Member

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?

Copy link
Member Author

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.

@sfackler
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 11, 2018

📌 Commit 426f06f has been approved by sfackler

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 11, 2018
@bors
Copy link
Collaborator

bors commented Jun 11, 2018

⌛ Testing commit 426f06f with merge a32e979...

bors added a commit that referenced this pull request Jun 11, 2018
Improve docs for slice::from_raw_parts

Explain why the pointer must be non-null and aligned.

Cc @hsivonen
@bors
Copy link
Collaborator

bors commented Jun 11, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: sfackler
Pushing a32e979 to master...

@bors bors merged commit 426f06f into rust-lang:master Jun 11, 2018
@RalfJung RalfJung deleted the from_raw_parts branch July 10, 2018 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants