Additional `*mut [T]` methods by the8472 · Pull Request #95594 · rust-lang/rust
This was referenced
Apr 2, 2022Split out from rust-lang#94247 This adds the following methods to raw slices that already exist on regular slices * `*mut [T]::is_empty` * `*mut [T]::split_at_mut` * `*mut [T]::split_at_unchecked` These methods reduce the amount of unsafe code needed to migrate ChunksMut and related iterators to raw slices (rust-lang#94247) Co-authored-by:: The 8472 <git@infinite-source.de>
dtolnay
added
the
T-libs-api
label
Apr 2, 2022`&mut [T]` implies validity which automatically makes `ptr::add` ok within its bounds. But `*mut [T]` does not. Since we still want the benefits of in-bounds pointer arithmetic `split_at_must` must require the caller to pass valid pointers and therefore it is `unsafe`.
bors
added
S-waiting-on-bors
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
May 31, 2022bors added a commit to rust-lang-ci/rust that referenced this pull request
Jun 1, 2022Rollup of 6 pull requests Successful merges: - rust-lang#95594 (Additional `*mut [T]` methods) - rust-lang#97130 (rustdoc: avoid including impl blocks with filled-in generics) - rust-lang#97166 (Move conditions out of recover/report functions.) - rust-lang#97605 (Mention filename in suggestion when it differs from primary span) - rust-lang#97613 (rustdoc: Improve calculation of "Impls on Foreign Types") - rust-lang#97626 (rename PointerAddress → PointerExposeAddress) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters