about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-11-24 08:23:53 +0100
committerGitHub <noreply@github.com>2023-11-24 08:23:53 +0100
commitc3216e2a3a64b2505120487f19ceef4cc5e98e2e (patch)
tree0914926a17635e473b27dae0ca520ab833546862
parentf38de06ce603100faf1c0b35b818efa12cf1c7cc (diff)
parentdb629211591f7ac8ab6d502d8bee3fce8b528312 (diff)
downloadrust-c3216e2a3a64b2505120487f19ceef4cc5e98e2e.tar.gz
rust-c3216e2a3a64b2505120487f19ceef4cc5e98e2e.zip
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
-rw-r--r--library/core/src/any.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index 8f5404d9713..22777fb078a 100644
--- a/library/core/src/any.rs
+++ b/library/core/src/any.rs
@@ -115,6 +115,11 @@ use crate::intrinsics;
 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
     ///
     /// ```