Skip to content

Commit 12cbe55

Browse files
Jules-Bertholetmeng-xu-cs
authored andcommitted
Document behavior of <dyn Any as Any>::type_id()
See also rust-lang#57893
1 parent a24a27f commit 12cbe55

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/core/src/any.rs

+5
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ use crate::intrinsics;
115115
pub trait Any: 'static {
116116
/// Gets the `TypeId` of `self`.
117117
///
118+
/// If called on a `dyn Any` trait object
119+
/// (or a trait object of a subtrait of `Any`),
120+
/// this returns the `TypeId` of the underlying
121+
/// concrete type, not that of `dyn Any` itself.
122+
///
118123
/// # Examples
119124
///
120125
/// ```

0 commit comments

Comments
 (0)