Open
Description
openedon Aug 20, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Category: A tracking issue for an RFC or an unstable feature.Issue: The decision needed by the team is conjectured to be easy.Relevant 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.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.