Add ptr::addr_eq
for use with pointers-to-DSTs
#274
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Proposal
Problem statement
As discussed in rust-lang/rust#106447 (and in the 2023-09-26 lang meeting that inspired this ACP), equality for pointers to DSTs is awkward.
Motivating examples or use cases
If we're going to work towards deprecating it, it would help to have methods with clear intent that people could use instead. That won't be a 100% solution (not even close), but at least there'd be a simple
Solution sketch
in core::ptr and std::ptr
Alternatives
PartialEq
implementation?addr_and_meta_eq
or something?Links and related work
What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: