[ACP 362] genericize `ptr::from_raw_parts` by scottmcm · Pull Request #125701 · rust-lang/rust

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

May 29, 2024

@scottmcm

WaffleLapkin

@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

May 29, 2024

fmease added a commit to fmease/rust that referenced this pull request

May 29, 2024
…=WaffleLapkin

[ACP 362] genericize `ptr::from_raw_parts`

This implements rust-lang/libs-team#362

As such, it can partially undo rust-lang#124795 , letting `slice_from_raw_parts` just call `from_raw_parts` again without re-introducing the unnecessary cast to MIR.

By doing this it also removes a spurious cast from `str::from_raw_parts`.  And I think it does a good job of showing the value of the ACP, since the only thing that needed new turbofishing because of this is inside `ptr::null(_mut)`, but only because `ptr::without_provenance(_mut)` doesn't support pointers to extern types, which it absolutely could (without even changing the implementation).

This was referenced

May 29, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

May 30, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#125653 (Migrate `run-make/const-prop-lint` to `rmake.rs`)
 - rust-lang#125662 (Rewrite `fpic`, `simple-dylib` and `issue-37893` `run-make` tests in `rmake.rs` or ui test format)
 - rust-lang#125699 (Streamline `x fmt` and improve its output)
 - rust-lang#125701 ([ACP 362] genericize `ptr::from_raw_parts`)
 - rust-lang#125723 (Migrate `run-make/crate-data-smoke` to `rmake.rs`)
 - rust-lang#125733 (Add lang items for `AsyncFn*`, `Future`, `AsyncFnKindHelper`'s associated types)
 - rust-lang#125734 (ast: Revert a breaking attribute visiting order change)

r? `@ghost`
`@rustbot` modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

May 30, 2024
Rollup merge of rust-lang#125701 - scottmcm:generic-from-raw-parts, r=WaffleLapkin

[ACP 362] genericize `ptr::from_raw_parts`

This implements rust-lang/libs-team#362

As such, it can partially undo rust-lang#124795 , letting `slice_from_raw_parts` just call `from_raw_parts` again without re-introducing the unnecessary cast to MIR.

By doing this it also removes a spurious cast from `str::from_raw_parts`.  And I think it does a good job of showing the value of the ACP, since the only thing that needed new turbofishing because of this is inside `ptr::null(_mut)`, but only because `ptr::without_provenance(_mut)` doesn't support pointers to extern types, which it absolutely could (without even changing the implementation).

@scottmcm scottmcm deleted the generic-from-raw-parts branch

May 30, 2024 17:47

egkoppel added a commit to popcorn-2/popcorn-2 that referenced this pull request

May 31, 2024

This was referenced

Nov 11, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Nov 12, 2024

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 12, 2024

stegaBOB added a commit to stegaBOB/ptr_meta that referenced this pull request

Apr 14, 2025

@stegaBOB