Skip to content

Tracking Issue for const_nonnull_new #93235

New issue

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

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

Already on GitHub? # to your account

Closed
3 of 4 tasks
lilasta opened this issue Jan 23, 2022 · 7 comments · Fixed by #134116
Closed
3 of 4 tasks

Tracking Issue for const_nonnull_new #93235

lilasta opened this issue Jan 23, 2022 · 7 comments · Fixed by #134116
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) 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. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Milestone

Comments

@lilasta
Copy link
Contributor

lilasta commented Jan 23, 2022

Feature gate: #![feature(const_nonnull_new)]

This is a tracking issue for implementing NonNull::new.

Public API

// core::ptr
impl<T: ?Sized> NonNull<T> {
    pub const fn new(ptr: *mut T) -> Option<Self>;
}

Steps / History

Unresolved Questions

@lilasta lilasta 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 Jan 23, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 29, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 29, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 29, 2022
@workingjubilee workingjubilee added A-const-fn A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) labels Sep 28, 2024
@workingjubilee
Copy link
Member

Quasi-blocked on #93235

@RalfJung
Copy link
Member

Quasi-blocked on #93235

I assume you mean #74939.

That one just finished FCP, so we can now move ahead with NonNull::new. :)
@rust-lang/libs-api this should be, finally, ready to be stabilized.

@RalfJung RalfJung added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 16, 2024
@dtolnay
Copy link
Member

dtolnay commented Nov 16, 2024

@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented Nov 16, 2024

Team member @dtolnay 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 Nov 16, 2024
@dtolnay dtolnay removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 16, 2024
@RalfJung
Copy link
Member

@BurntSushi @joshtriplett @m-ou-se friendly FCP checkbox reminder :) There's tons of cases out there of people using the unsafe NonNull::new_unchecked just because it works in const, so making its safe cousin available would be nice.

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Nov 30, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Nov 30, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Nov 30, 2024
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Dec 10, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Dec 10, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Dec 10, 2024
fmease added a commit to fmease/rust that referenced this issue Dec 10, 2024
@bors bors closed this as completed in e822dfc Dec 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 11, 2024
Rollup merge of rust-lang#134116 - RalfJung:const_nonnull_new, r=jhpratt

stabilize const_nonnull_new

FCP passed in rust-lang#93235

Closes rust-lang#93235
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Dec 19, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.85.0 milestone Jan 20, 2025
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this issue Mar 11, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) 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. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants