Skip to content
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

Explain why zero-length slices require a non-null pointer #41602

Merged
merged 1 commit into from
Apr 30, 2017

Conversation

hsivonen
Copy link
Member

In reference to a thread on Discourse, explain why from_raw_parts requires a non-null pointer for zero-length slices.

r? @steveklabnik

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@shepmaster shepmaster added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 28, 2017
@shepmaster
Copy link
Member

Thanks for the contribution! We will make sure that @steveklabnik or another member of the team takes a look at this in a reasonable amount of time.

@steveklabnik
Copy link
Member

@rust-lang/libs, are you comfortable with this explanation? /cc @nagisa especially, we had a very recent conversation recently

@nagisa
Copy link
Member

nagisa commented Apr 29, 2017

The explanation sounds reasonable and fine to me. Discussing about Some/None is an okay way to describe the slice is NonZero IMO.

@alexcrichton
Copy link
Member

👍

@steveklabnik
Copy link
Member

@bors: r+ rollup

Great, thanks a ton!

@bors
Copy link
Contributor

bors commented Apr 30, 2017

📌 Commit e36f59e has been approved by steveklabnik

@bors
Copy link
Contributor

bors commented Apr 30, 2017

⌛ Testing commit e36f59e with merge c0f86f5...

bors added a commit that referenced this pull request Apr 30, 2017
Explain why zero-length slices require a non-null pointer

In reference to [a thread on Discourse](https://users.rust-lang.org/t/why-does-std-slice-from-raw-parts-require-a-non-null-pointer-for-zero-length-slices/10534), explain why `from_raw_parts` requires a non-null pointer for zero-length slices.

r? @steveklabnik
@bors
Copy link
Contributor

bors commented Apr 30, 2017

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

@bors bors merged commit e36f59e into rust-lang:master Apr 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants