Skip to content

Conversation

WaffleLapkin
Copy link
Member

Responses to #90012 seem to allow @rust-lang/wg-const-eval to decide on use of const_eval_select, so we can make core::slice::from_raw_parts[_mut] const :)


This PR marks the following APIs as const:

// core::slice
pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T];
pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T];

Resolves #90011
r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 28, 2021
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 30, 2021

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 30, 2021

📌 Commit afaa54a has been approved by oli-obk

@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 Oct 30, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 30, 2021
…arts, r=oli-obk

Make `core::slice::from_raw_parts[_mut]` const

Responses to rust-lang#90012 seem to allow `@rust-lang/wg-const-eval` to decide on use of `const_eval_select`, so we can make `core::slice::from_raw_parts[_mut]` const :)

---
This PR marks the following APIs as const:
```rust
// core::slice
pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T];
pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T];
```
---

Resolves rust-lang#90011
r? `@oli-obk`
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 30, 2021
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#89876 (Make most std::ops traits const on numeric types)
 - rust-lang#90371 (Fix incorrect doc link)
 - rust-lang#90374 (Unify titles in rustdoc book doc attributes chapter)
 - rust-lang#90377 (Make `core::slice::from_raw_parts[_mut]` const)
 - rust-lang#90395 (Restrict liveness of mutable borrow of inner infcx in ConstInferUnifier::consts)
 - rust-lang#90396 (Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred)
 - rust-lang#90402 (Add a few query descriptions)
 - rust-lang#90412 (Remove unnecessary `macro_use`s in rustdoc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b531364 into rust-lang:master Oct 30, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 30, 2021
@WaffleLapkin WaffleLapkin deleted the const_slice_from_raw_parts branch October 30, 2021 18:17
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.

Make slice::from_raw_parts[_mut] const
6 participants