-
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
make slice::{split_at,split_at_unchecked} const functions #100076
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
r? @thomcc (rust-highfive has picked a reviewer for you, use r? to override) |
The logic in |
Makes public stable method @rustbot label +T-libs-api -T-libs |
6183707
to
4b90601
Compare
4b90601
to
97c963d
Compare
Sorry for the delay. It took some discussion as to the process here for making these unstably const. It seems like the process for unstably constifying something is to get some signoff from @rust-lang/wg-const-eval that this is reasonable to have as an (unstable) const fn, and then I can review it. Hopefully the @ above works to ping someone. |
r? @oli-obk yea, wg-const-eval can do unstable constifications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with reviews by oli addressed.
@bors r+ rollup |
Should I create a tracking issue for |
…li-obk make slice::{split_at,split_at_unchecked} const functions Now that `slice::from_raw_parts` is const in stable 1.64, it makes sense to have `split_at` const as well, otherwise unsafe code is required to achieve a const equivalent.
Rollup of 8 pull requests Successful merges: - rust-lang#99064 (distinguish the method and associated function diagnostic information) - rust-lang#99920 (Custom allocator support in `rustc_serialize`) - rust-lang#100034 ( Elaborate all box dereferences in `ElaborateBoxDerefs`) - rust-lang#100076 (make slice::{split_at,split_at_unchecked} const functions) - rust-lang#100604 (Remove unstable Result::into_ok_or_err) - rust-lang#100933 (Reduce code size of `assert_matches_failed`) - rust-lang#100978 (Handle `Err` in `ast::LitKind::to_token_lit`.) - rust-lang#101010 (rustdoc: remove unused CSS for `.multi-column`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Now that
slice::from_raw_parts
is const in stable 1.64, it makes sense to havesplit_at
const as well, otherwise unsafe code is required to achieve a const equivalent.