-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add docs note about Any::type_id
on smart pointers
#79870
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
Conversation
r? @shepmaster (rust-highfive has picked a reviewer for you, use r? to override) |
@sharnoff I edited the PR description so this closes the issue once merged. |
Cool, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits.
Co-authored-by: Camelid <[email protected]>
Hey @camelid - what are the next steps for this? |
You'll have to wait for your assigned reviewer, shepmaster, to review this. Sometimes reviews can take up to 10-15 days because people may have full-time jobs and/or a lot of other commitments. |
Cool, makes sense - thanks! |
@bors r+ rollup Thanks! |
📌 Commit 72a7f73 has been approved by |
☀️ Test successful - checks-actions |
Fixes #79868.
There's an issue I've run into a couple times while using values of type
Box<dyn Any>
- essentially, callingvalue.type_id()
doesn't dereference to the trait object, but uses the implementation ofAny
forBox<dyn Any>
, giving us theTypeId
of the container instead of the object inside it.I couldn't find any notes about this in the documentation and - while it could be inferred from existing knowledge of Rust and the blanket implemenation of
Any
- I think it'd be nice to have a note about it in the documentation for theany
module.Anyways, here's a first draft of a section about it. I'm happy to revise wording :)