-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
stabilize slice_align_to #53754
stabilize slice_align_to #53754
Conversation
r? @Kimundi (rust_highfive has picked a reviewer for you, use r? to override) |
The steps in the tracking issue talk about "adjusting documentation", to what extend does that apply to lib features? I grepped for all uses of the feature flag, and found no more than what this PR removes. |
Ping from triage @Kimundi / @rust-lang/libs: This PR requires your review. |
@rfcbot fcp merge This seems like a nifty API that would be quite useful in appropriate situations, so seems like a good idea to me to stabilize! |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), 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. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. |
@bors r=alexcrichton |
📌 Commit f4f1140 has been approved by |
⌛ Testing commit f4f1140 with merge 4fdb0ab3a3551a987e1fbfb2f07f7b37974d6f01... |
⌛ Testing commit f4f1140 with merge 447fd25aaf554abf8c1f18c331d2463cce2ebae8... |
Looks like all tests passed (on both Travis and Appveyor) but @bors never noticed. |
@bors retry Probably caused by the bors re-deploy. Edit: The homu queue is outdated, gonna synchronize. |
stabilize slice_align_to This is very hard to implement correctly, and leads to [serious bugs](llogiq/bytecount#42) when done incorrectly. Moreover, this is needed to be able to run code that opportunistically exploits alignment on miri. So code using `align_to`/`align_to_mut` gets the benefit of a well-tested implementation *and* of being able to run in miri to test for (some kinds of) UB. This PR also clarifies the guarantee wrt. the middle part being as long as possible. Should the docs say under which circumstances the middle part could be shorter? Currently, that can only happen when running in miri.
☀️ Test successful - status-appveyor, status-travis |
I know this is way too late, but I just found out about this method, and I must say this: it might have been nicer if it had this signature:
which would still have worked for Edit: although that would actually have had to return |
This is very hard to implement correctly, and leads to serious bugs when done incorrectly. Moreover, this is needed to be able to run code that opportunistically exploits alignment on miri. So code using
align_to
/align_to_mut
gets the benefit of a well-tested implementation and of being able to run in miri to test for (some kinds of) UB.This PR also clarifies the guarantee wrt. the middle part being as long as possible. Should the docs say under which circumstances the middle part could be shorter? Currently, that can only happen when running in miri.