-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
std::fmt::Pointer should be implemented for pointers to T: ?Sized #30427
Comments
Boxed trait objects contain two pointers - one to the object and the other to the vtable. Should only one be printed? |
Oh, that is a very good point, thanks. This is not nearly as obvious as I thought. I was assuming that the data pointer would be printed, but if you see any possible downside to implementing that, then I'll be entirely satisfied with transmuting to TraitObject and printing the data field for myself. |
Considering trait pointers can be cast to thin pointers, whatever pointer that yields is the one. |
This was fixed by #31479. |
Example:
I think Pointer should be impled as follows:
and likewise for borrowed refs, raw pointers, Arc etc.
The text was updated successfully, but these errors were encountered: