Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for non_null_from_ref #130823

Open
2 of 4 tasks
bjoernager opened this issue Sep 25, 2024 · 4 comments
Open
2 of 4 tasks

Tracking Issue for non_null_from_ref #130823

bjoernager opened this issue Sep 25, 2024 · 4 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@bjoernager
Copy link
Contributor

bjoernager commented Sep 25, 2024

Feature gate: #![feature(non_null_from_ref)]

This is a tracking issue for adding the convenience constructors from_ref and from_mut to core::ptr::NonNull.

Public API

// core::ptr

impl<T: ?Sized> NonNull<T> {
    pub const fn from_ref(r: &T) -> Self;

    pub const fn from_mut(r: &mut T) -> Self;
}

Steps / History

Unresolved Questions

  • None yet.
@bjoernager bjoernager added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 25, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 16, 2024
…olnay

Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`.

Relevant tracking issue: rust-lang#130823

The `core::ptr::NonNull` type should have the convenience constructors `from_ref` and `from_mut` for parity with `core::ptr::from_ref` and `core::ptr::from_mut`.

Although the type in question already implements `From<&T>` and `From<&mut T>`, these new functions also carry the ability to be used in constant expressions (due to not being behind a trait).
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 16, 2024
Rollup merge of rust-lang#130822 - bjoernager:non-null-from-ref, r=dtolnay

Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`.

Relevant tracking issue: rust-lang#130823

The `core::ptr::NonNull` type should have the convenience constructors `from_ref` and `from_mut` for parity with `core::ptr::from_ref` and `core::ptr::from_mut`.

Although the type in question already implements `From<&T>` and `From<&mut T>`, these new functions also carry the ability to be used in constant expressions (due to not being behind a trait).
@smalis-msft
Copy link

Is there anything blocking these from stabilization? They seem pretty straightforward.

@bjoernager
Copy link
Contributor Author

bjoernager commented Jan 30, 2025

Nope, nothing that I'm aware of (other than the FCP).

@m-ou-se
Copy link
Member

m-ou-se commented Feb 19, 2025

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Feb 19, 2025

Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants