Files
rust/library/alloc
Jonathan Brouwer b3bc4026a8 Rollup merge of #157347 - theemathas:box-as-non-null, r=Darksonn
Implement `Box::as_non_null()`.

ACP: <https://github.com/rust-lang/libs-team/issues/799>
Tracking issue: <https://github.com/rust-lang/rust/issues/157345>

The docs are mostly copied from `Box::as_mut_ptr()`

I also made a drive-by change to add `#[must_use]` to `Box::as_{ptr, mut_ptr}`.

I'm unsure what `#[rustc_never_returns_null_ptr]` and `#[rustc_as_ptr]` do. Should `Box::as_non_null()` be annotated with them?

r? libs-api
2026-06-30 22:29:28 +02:00
..