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
Contributor

TimDiekmann commented Mar 7, 2020

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

@Amanieu

This comment has been minimized.

Copy link
Contributor

Amanieu commented Mar 7, 2020

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 7, 2020

📌 Commit 09d3ba1 has been approved by Amanieu

@bors

This comment has been minimized.

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

@Amanieu

This comment has been minimized.

Copy link
Contributor

Amanieu commented Mar 7, 2020

@bors r+ rollup=always

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 7, 2020

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

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 7, 2020

📌 Commit 09d3ba1 has been approved by Amanieu

@bors

This comment has been minimized.

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 7, 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 added a commit that referenced this pull request Mar 7, 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 added a commit that referenced this pull request Mar 7, 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 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 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 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
4 checks passed
4 checks passed
pr Build #20200307.6 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@TimDiekmann TimDiekmann deleted the TimDiekmann:dangling branch Mar 8, 2020
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.