Rollup merge of #118028 - Jules-Bertholet:dyn-any-doc, r=thomcc

Document behavior of `<dyn Any as Any>::type_id()`

See also #57893

`@rustbot` label A-docs T-libs
This commit is contained in:
Matthias Krüger 2023-11-24 08:23:53 +01:00 committed by GitHub
commit c3216e2a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,11 @@
pub trait Any: 'static {
/// Gets the `TypeId` of `self`.
///
/// If called on a `dyn Any` trait object
/// (or a trait object of a subtrait of `Any`),
/// this returns the `TypeId` of the underlying
/// concrete type, not that of `dyn Any` itself.
///
/// # Examples
///
/// ```