Uh oh!
There was an error while loading. Please reload this page.
Stabilize most common subset of alloc_layout_extras - #69362
Conversation
CAD97
commented
Feb 21, 2020
whoops I broke highfive by r-ing a team, so rng says... r? @dtolnay |
Amanieu
commented
Feb 21, 2020
I would like |
CAD97
commented
Feb 22, 2020
Personally, I'm not comfortable making the call on whether In another formulation, I don't feel confident calling for the stabilization of |
Amanieu
commented
Feb 22, 2020
Fair enough, let's defer on @rfcbot fcp merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
CAD97
commented
Mar 27, 2020
Amended to refer to a 1.44 stabilization in the attributes. |
bors
commented
Apr 2, 2020
☔ The latest upstream changes (presumably #70362) made this pull request unmergeable. Please resolve the merge conflicts. |
Amanieu
commented
Apr 2, 2020
ping @sfackler@KodrAus@withoutboats for checkboxes. |
1 similar comment
Amanieu
commented
Apr 7, 2020
ping @sfackler@KodrAus@withoutboats for checkboxes. |
CAD97
commented
Apr 8, 2020
Rebased. |
Amanieu
commented
Apr 10, 2020
(I went ahead and checked for @KodrAus since he's busy) |
rfcbot
commented
Apr 10, 2020
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Ralf Jung <post@ralfj.de>
rfcbot
commented
Apr 20, 2020
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Amanieu
left a comment
There was a problem hiding this comment.
r=me after fixing the doc comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Amanieu d'Antras <amanieu@gmail.com>
Amanieu
commented
Apr 20, 2020
@bors r+ |
bors
commented
Apr 20, 2020
📌 Commit 98f0a82 has been approved by |
Rollup of 4 pull requests Successful merges: - rust-lang#69362 (Stabilize most common subset of alloc_layout_extras) - rust-lang#71174 (Check that main/start is not async) - rust-lang#71285 (MIR: use HirId instead of NodeId to avoid cycles while inlining) - rust-lang#71346 (Do not build tools if user do not want them) Failed merges: r? @ghost
A subset of this feature was stabilized in rust-lang/rust#69362, and none of the still-unstable methods are in use in `blog_os`
A subset of this feature was stabilized in rust-lang/rust#69362, and none of the still-unstable methods are in use in `blog_os`
Tracking issue: #55724
Specifically, this stabilizes:
Methods that are tracked by #55724 but are not stabilized here:
Combined, these stabilized functions allow code to construct and manipulate
repr(C)layouts while letting the standard library handle correctness in the face of edge cases. For example use cases, consider the usage in hashbrown, crossbeam-skiplist, pointer-utils/slice-dst, and of course the standard library itself.Providing a higher-level API such as
Layout::repr_c<const N: usize>(fields: [Layout; N]) -> Result<(Layout, [usize; N]), LayoutErr>is blocked on const generics, which are a ways off. Providing an API that doesn't provide offsets would be quite suboptimal, as the reason for calculating the layout like this rather thanLayout::newis to get the field offsets.The primary issue with the current API is having to call
.pad_to_align()to match the layout of arepr(C)struct. However, I think this is not just a (failing? limitation?) of the API, but rather intrinsic complexity. While all Rust-defined types have size==stride, and probably will for the foreseeable future, there is no inherent reason why this is a limitation of all allocations. As such, theLayoutmanipulation APIs shouldn't impose this limitation, and instead the higher level api ofrepr_c(or just plain old usingLayout::new) can make keeping it simple.cc @matklad r? @rust-lang/libs