rust/library/core
bors f6b6d5cf64 Auto merge of #79870 - sharnoff:smart-pointer-Any-type_id, r=shepmaster
Add docs note about `Any::type_id` on smart pointers

Fixes #79868.

There's an issue I've run into a couple times while using values of type `Box<dyn Any>` - essentially, calling `value.type_id()` doesn't dereference to the trait object, but uses the implementation of `Any` for `Box<dyn Any>`, giving us the `TypeId` 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 the `any` module.

Anyways, here's a first draft of a section about it. I'm happy to revise wording :)
2021-01-02 04:12:48 +00:00
..
benches Remove redundant 'static from library crates 2020-10-18 17:25:51 +02:00
src Auto merge of #79870 - sharnoff:smart-pointer-Any-type_id, r=shepmaster 2021-01-02 04:12:48 +00:00
tests Auto merge of #79895 - Kerollmops:slice-group-by, r=m-ou-se 2020-12-31 12:00:43 +00:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00