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

improve from_raw_parts docs #66111

Merged
merged 5 commits into from
Nov 7, 2019
Merged

improve from_raw_parts docs #66111

merged 5 commits into from
Nov 7, 2019

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Nov 5, 2019

Triggered by rust-lang/rfcs#2806. Hopefully this helps clarify that joining slices across allocations is not possible in Rust currently.

r? @Centril

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 5, 2019
@rust-highfive

This comment has been minimized.

src/libcore/ptr/mod.rs Outdated Show resolved Hide resolved
src/libcore/ptr/mod.rs Outdated Show resolved Hide resolved
@@ -18,6 +18,10 @@
//! * A [null] pointer is *never* valid, not even for accesses of [size zero][zst].
//! * All pointers (except for the null pointer) are valid for all operations of
//! [size zero][zst].
//! * For a pointer to be valid, it is necessary (but not always sufficient) that the pointer
//! be *dereferencable*: the memory range of the given size starting at the pointer must all be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fairly abstract and packed -- can we give an example perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's not really a good way (that I can think of) to do that in the current format -- it would need basically a re-write of this section, I think. And the phrasing is similar to our existing docs for, e.g., ptr::offset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah; alright -- better to have some docs than none. r=me if you are happy with the current state.

Co-Authored-By: Mazdak Farrokhzad <[email protected]>
@Centril Centril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2019
@RalfJung
Copy link
Member Author

RalfJung commented Nov 6, 2019

@bors r=Centril

@bors
Copy link
Contributor

bors commented Nov 6, 2019

📌 Commit 11a48a0 has been approved by Centril

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 6, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 6, 2019
improve from_raw_parts docs

Triggered by rust-lang/rfcs#2806. Hopefully this helps clarify that joining slices across allocations is not possible in Rust currently.

r? @Centril
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 6, 2019
improve from_raw_parts docs

Triggered by rust-lang/rfcs#2806. Hopefully this helps clarify that joining slices across allocations is not possible in Rust currently.

r? @Centril
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 7, 2019
improve from_raw_parts docs

Triggered by rust-lang/rfcs#2806. Hopefully this helps clarify that joining slices across allocations is not possible in Rust currently.

r? @Centril
bors added a commit that referenced this pull request Nov 7, 2019
Rollup of 12 pull requests

Successful merges:

 - #65794 (gate rustc_on_unimplemented under rustc_attrs)
 - #65945 (Optimize long-linker-command-line test)
 - #66044 (Improve uninit/zeroed lint)
 - #66076 (HIR docs: mention how to resolve method paths)
 - #66084 (Do not require extra LLVM backends for `x.py test` to pass)
 - #66111 (improve from_raw_parts docs)
 - #66114 (Improve std::thread::Result documentation)
 - #66117 (Fixed PhantomData markers in Arc and Rc)
 - #66146 (Remove unused parameters in `__thread_local_inner`)
 - #66147 (Miri: Refactor to_scalar_ptr out of existence)
 - #66162 (Fix broken link in README)
 - #66171 (Update link on CONTRIBUTING.md)

Failed merges:

r? @ghost
@bors bors merged commit 11a48a0 into rust-lang:master Nov 7, 2019
@RalfJung RalfJung deleted the from_raw_parts branch November 7, 2019 08:43
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants