Repository navigation
Tracking Issue for ptr::fn_addr_eq #129322
Copy link
Copy link
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-lang-easy-decisionIssue: The decision needed by the team is conjectured to be easy; this does not imply nominationIssue: The decision needed by the team is conjectured to be easy; this does not imply nominationT-langRelevant to the language teamRelevant to the language teamT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Milestone
Description
Feature gate: #![feature(ptr_fn_addr_eq)]
This is a tracking issue for std::ptr::fn_addr_eq
Compares the addresses of the two function pointers for equality.
Public API
// core::ptr
/// Compares the *addresses* of the two function pointers for equality.
///
/// Function pointers comparisons can have surprising results since
/// they are never guaranteed to be unique and could vary between different
/// code generation units. Furthermore, different functions could have the
/// same address after being merged together.
///
/// This is the same as `f == g` but using this function makes clear
/// that you are aware of these potentially surprising semantics.
pub fn fn_addr_eq<T: FnPtr, U: FnPtr>(f: T, g: U) -> bool {
f.addr() == g.addr()
}Steps / History
- ACP: Add
ptr::fn_addr_eqto compare functions pointers. libs-team#323 - Implementation: Implement
ptr::fn_addr_eq#129323 and Expandptr::fn_addr_eq()documentation. #131457 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-lang-easy-decisionIssue: The decision needed by the team is conjectured to be easy; this does not imply nominationIssue: The decision needed by the team is conjectured to be easy; this does not imply nominationT-langRelevant to the language teamRelevant to the language teamT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Activity
Urgau commentedon Oct 17, 2024
T-lang as started an FCP for adding a lint against function pointer comparisons and would like to use this method
ptr::fn_addr_eqas recommendation to suppress the lint and hang documentation about caveats.Stabilization Report
Implementation History
ptr::fn_addr_eq#129323ptr::fn_addr_eq()documentation. #131457(waiting on review, but doesn't prevent FCP)API Summary
The
std::marker::FnPtrboundThe
FnPtrmarker trait is not stable and would be not stabilized by this FCP, but this commits us to having such trait (even in this unstable form).cc @rust-lang/lang (regarding the
FnPtrbound)cc @rust-lang/libs-api
dtolnay commentedon Oct 17, 2024
@rfcbot fcp merge
rfcbot commentedon Oct 17, 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!
cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.
traviscross commentedon Oct 17, 2024
@rfcbot reviewed
Rollup merge of rust-lang#131457 - kpreid:fnaddr, r=dtolnay
Unrolled build for rust-lang#131457
nikomatsakis commentedon Oct 30, 2024
@rfcbot reviewed
traviscross commentedon Oct 30, 2024
@rustbot labels -I-lang-nominated
We discussed this in triage today. We've now unanimously checked off on the lang side. We appreciate @rust-lang/libs-api for moving this forward in support of the pending lang work.
1 remaining item
rfcbot commentedon Nov 19, 2024
🔔 This is now entering its final comment period, as per the review above. 🔔
rfcbot commentedon Nov 29, 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.
Rollup merge of rust-lang#133678 - Urgau:stabilize-ptr_fn_addr_eq, r=…
Unrolled build for rust-lang#133678
Rollup merge of rust-lang#133678 - Urgau:stabilize-ptr_fn_addr_eq, r=…