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
Metadata
Metadata
Assignees
Labels
Category: An issue tracking the progress of sth. like the implementation of an RFCIssue: The decision needed by the team is conjectured to be easy; this does not imply nominationRelevant to the language 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.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.