-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.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_eq
to 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
orzogc
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-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.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.