Implement Box::as_non_null().#157347
Conversation
|
I'm unsure about |
This comment has been minimized.
This comment has been minimized.
ACP: <rust-lang/libs-team#799> Tracking issue: <rust-lang#157345> The docs are mostly copied from `Box::as_mut_ptr()`
021f8ba to
5a39872
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 reroll |
|
I think that |
|
I'm told that libs-api doesn't do reviews. Oops. r? libs |
There was a problem hiding this comment.
Looks good to me. I agree with the PRs current choice of annotating with #[rustc_as_ptr] but not #[rustc_never_returns_null_ptr].
@bors r+ rollup
…sonn Implement `Box::as_non_null()`. ACP: <rust-lang/libs-team#799> Tracking issue: <rust-lang#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
…uwer Rollup of 7 pull requests Successful merges: - #156379 (lint on `core::ffi::c_void` as a return type) - #157347 (Implement `Box::as_non_null()`.) - #157650 (rustc_target: Add OpenEmbedded/Yocto Linux base targets) - #158569 ([rustdoc] Fix handling of inlining of `no_inline` of foreign items) - #158573 (stabilize `feature(atomic_from_mut)`) - #158614 (Fix error message when rejecting implicit stage != 2 in CI) - #158616 (Remove dependency from `rustc_metadata` on `rustc_incremental`)
Rollup merge of #157347 - theemathas:box-as-non-null, r=Darksonn Implement `Box::as_non_null()`. ACP: <rust-lang/libs-team#799> Tracking issue: <#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
…uwer Rollup of 7 pull requests Successful merges: - rust-lang/rust#156379 (lint on `core::ffi::c_void` as a return type) - rust-lang/rust#157347 (Implement `Box::as_non_null()`.) - rust-lang/rust#157650 (rustc_target: Add OpenEmbedded/Yocto Linux base targets) - rust-lang/rust#158569 ([rustdoc] Fix handling of inlining of `no_inline` of foreign items) - rust-lang/rust#158573 (stabilize `feature(atomic_from_mut)`) - rust-lang/rust#158614 (Fix error message when rejecting implicit stage != 2 in CI) - rust-lang/rust#158616 (Remove dependency from `rustc_metadata` on `rustc_incremental`)
ACP: rust-lang/libs-team#799
Tracking issue: #157345
The docs are mostly copied from
Box::as_mut_ptr()I also made a drive-by change to add
#[must_use]toBox::as_{ptr, mut_ptr}.I'm unsure what
#[rustc_never_returns_null_ptr]and#[rustc_as_ptr]do. ShouldBox::as_non_null()be annotated with them?r? libs-api