Migrate libraries from ptr::slice_from_raw_parts to .cast_slice#156109
Conversation
|
cc @Amanieu, @folkertdev, @sayantn |
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
some notable places like core::slice::from_raw_parts have not been updated, because i felt like changing that would harm readability than improving it. |
This comment has been minimized.
This comment has been minimized.
|
hmm wait let me revert that doc change, apparently it is exactly the same in |
This comment has been minimized.
This comment has been minimized.
5533d7b to
fced58f
Compare
|
Could |
Aside from this, |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
i believe they are equivalent other than the debug UB assertion, yes |
|
I'm not touching anything in;
with that, i think this pr is ready @rustbot ready |
fced58f to
e030a3f
Compare
The |
e030a3f to
14315f9
Compare
done |
|
@bors r+ rollup |
This comment has been minimized.
This comment has been minimized.
Migrate libraries from ptr::slice_from_raw_parts to .cast_slice Tracking issue for `#![feature(ptr_cast_slice)]`: #149103 This commit updates most callsites of ptr::slice_from_raw_parts within ./library to the more concise but unstable postfix `.cast_slice()` method on raw pointers, using the `ptr_cast_slice` feature. Some tests in alloctests have also been updated. No functional change, debatably improved readability.
This comment has been minimized.
This comment has been minimized.
|
💔 Test for bce7e50 failed: CI. Failed job:
|
|
Apparently this file requires changes: rust/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff Lines 39 to 42 in 3e353d7 |
2ab86ba to
e6cc90a
Compare
|
i ran all tests with --bless and the only change was that file, pushed the changes |
e6cc90a to
cd1f625
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
|
any updates? @jhpratt |
|
Sorry, I was travelling Europe for the past couple weeks :) @bors r+ |
…nts, r=jhpratt Migrate libraries from ptr::slice_from_raw_parts to .cast_slice Tracking issue for `#![feature(ptr_cast_slice)]`: rust-lang#149103 This commit updates most callsites of ptr::slice_from_raw_parts within ./library to the more concise but unstable postfix `.cast_slice()` method on raw pointers, using the `ptr_cast_slice` feature. Some tests in alloctests have also been updated. No functional change, debatably improved readability.
Rollup of 6 pull requests Successful merges: - #156832 (library: use strict provenance lints consistently) - #157006 (net tests: let the OS pick the port numbers) - #157126 (Avoid redundant note when a #[derive] is already suggested) - #151690 (std: Refactor `env::var` function) - #155826 (std::process: uefi: avoid panicking in Stdio From impls.) - #156109 (Migrate libraries from ptr::slice_from_raw_parts to .cast_slice)
…uwer Rollup of 8 pull requests Successful merges: - #157006 (net tests: let the OS pick the port numbers) - #157126 (Avoid redundant note when a #[derive] is already suggested) - #151690 (std: Refactor `env::var` function) - #155826 (std::process: uefi: avoid panicking in Stdio From impls.) - #156109 (Migrate libraries from ptr::slice_from_raw_parts to .cast_slice) - #156642 (`offload_kernel` macro expansion) - #156823 (Add regression test) - #157162 (elaborate_drop: Avoid as_mut.unwrap dance, empty vectors are cheap.) Failed merges: - #157173 (rustc-dev-guide subtree update)
Rollup merge of #156109 - Paladynee:lib/cast-slice-improvements, r=jhpratt Migrate libraries from ptr::slice_from_raw_parts to .cast_slice Tracking issue for `#![feature(ptr_cast_slice)]`: #149103 This commit updates most callsites of ptr::slice_from_raw_parts within ./library to the more concise but unstable postfix `.cast_slice()` method on raw pointers, using the `ptr_cast_slice` feature. Some tests in alloctests have also been updated. No functional change, debatably improved readability.

View all comments
Tracking issue for
#![feature(ptr_cast_slice)]: #149103This commit updates most callsites of ptr::slice_from_raw_parts within ./library to the more concise but unstable postfix
.cast_slice()method on raw pointers, using theptr_cast_slicefeature. Some tests in alloctests have also been updated.No functional change, debatably improved readability.