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

Add Layout::dangling() to return a well-aligned NonNull<u8> #69794

Merged
merged 2 commits into from
Mar 8, 2020

Conversation

TimDiekmann
Copy link
Member

Adds a convenient function to Layout to create a NonNull<u8> out of a layout to be returned on ZST allocations.

This is the first item on the roadmap to support ZSTs in AllocRef: rust-lang/wg-allocators#38 (comment)

r? @Amanieu

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 7, 2020
@Amanieu
Copy link
Member

Amanieu commented Mar 7, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Mar 7, 2020

📌 Commit 09d3ba1 has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Mar 7, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@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 Mar 7, 2020
@Amanieu
Copy link
Member

Amanieu commented Mar 7, 2020

@bors r+ rollup=always

@bors
Copy link
Contributor

bors commented Mar 7, 2020

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Mar 7, 2020

📌 Commit 09d3ba1 has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Mar 7, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

bors added a commit that referenced this pull request Mar 8, 2020
Rollup of 8 pull requests

Successful merges:

 - #69667 (Remove the `no_debug` feature)
 - #69687 (resolve, inconsistent binding mode: tweak wording)
 - #69708 (On mismatched delimiters, only point at empty blocks that are in the same line)
 - #69765 (reduce test size for Miri)
 - #69773 (fix various typos)
 - #69787 (mir::Local is Copy we can pass it by value in these cases)
 - #69794 (Add `Layout::dangling()` to return a well-aligned `NonNull<u8>`)
 - #69797 (Correct version that relaxed orphan rules)

Failed merges:

r? @ghost
@bors bors merged commit 963b0aa into rust-lang:master Mar 8, 2020
@TimDiekmann TimDiekmann deleted the dangling branch March 8, 2020 10:51
Centril added a commit to Centril/rust that referenced this pull request Mar 9, 2020
Allow ZSTs in `AllocRef`

Allows ZSTs in all `AllocRef` methods. The implementation of `AllocRef` for `Global` and `System` were adjusted to reflect those changes.

This is the second item on the roadmap to support ZSTs in `AllocRef`: rust-lang/wg-allocators#38 (comment)
After this has landed, I will adapt `RawVec`, but since this will be a pretty big overhaul, it makes sense to do a different PR for it.

~~Requires rust-lang#69794 to land first~~

r? @Amanieu
Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2020
Allow ZSTs in `AllocRef`

Allows ZSTs in all `AllocRef` methods. The implementation of `AllocRef` for `Global` and `System` were adjusted to reflect those changes.

This is the second item on the roadmap to support ZSTs in `AllocRef`: rust-lang/wg-allocators#38 (comment)
After this has landed, I will adapt `RawVec`, but since this will be a pretty big overhaul, it makes sense to do a different PR for it.

~~Requires rust-lang#69794 to land first~~

r? @Amanieu
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