about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorJules Bertholet <julesbertholet@quoi.xyz>2023-11-17 19:54:37 -0500
committerJules Bertholet <julesbertholet@quoi.xyz>2023-11-17 19:54:37 -0500
commitdb629211591f7ac8ab6d502d8bee3fce8b528312 (patch)
tree5d04f0bf438b228ba95e5fdc0cf4092fc16a7d36 /library/core/src
parent1db4b12494f698754b925f55061eb9e6b3241423 (diff)
downloadrust-db629211591f7ac8ab6d502d8bee3fce8b528312.tar.gz
rust-db629211591f7ac8ab6d502d8bee3fce8b528312.zip
Document behavior of `<dyn Any as Any>::type_id()`
See also #57893
Diffstat (limited to 'library/core/src')
-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
     ///
     /// ```