[ACP 362] genericize ptr::from_raw_parts by scottmcm · Pull Request #125701 · rust-lang/rust (original) (raw)

This implements rust-lang/libs-team#362

As such, it can partially undo #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).