-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DynMetadata equality is not documented #99388
Comments
Vtables are likely not unique at the moment. Yes, documenting that explicitly sounds good. Related: #69757 |
Is it necessary to have |
All raw pointers (including to trait objects) implement However the current implementation of raw pointer comparison is just bitwise comparison and does not go through |
One can compare vtable pointers via wide raw pointer comparison, so for better or worse I think we should also allow it on |
Rollup merge of rust-lang#120880 - RalfJung:vtable-fnptr-partialeq, r=cuviper add note on comparing vtables / function pointers Fixes rust-lang#99388 Fixes rust-lang#117047
Location
https://doc.rust-lang.org/std/ptr/struct.DynMetadata.html
Summary
There is no documentation as far as I should see that defines the behaviour of the
PartialEq
impl forDynMetadata
. I think the guarantees that are made or not made should be documented. For instance, are vtables for a given concrete type guaranteed to be unique? People will assume they are, and that==
will tell you if the types match. It would not surprise me to learn that this is wrong.The text was updated successfully, but these errors were encountered: