Make Box
comparisons independent of allocator choice
#241
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
Comparing
Box
s that are allocated by different allocators viaPartialEq
orPartialOrd
is not currently possible.Motivating examples or use cases
PartialEq<Vec<U, A2>> for Vec<T, A1>
.expected
, and compare it with data that Igot
. Resorting toDeref<Target = T>
and comparing individual fields may be very tedious in cases when the data in question contains several layers of types internally, and especially enums.Solution sketch
See PR: rust-lang/rust#112628
Alternatives
Box
s viaDeref<Target = T>
.The text was updated successfully, but these errors were encountered: