From db629211591f7ac8ab6d502d8bee3fce8b528312 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Fri, 17 Nov 2023 19:54:37 -0500 Subject: [PATCH] Document behavior of `::type_id()` See also #57893 --- library/core/src/any.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 8f5404d9713dd..22777fb078a26 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 /// /// ```