Skip to content

Commit c3216e2

Browse files
authored
Rollup merge of rust-lang#118028 - Jules-Bertholet:dyn-any-doc, r=thomcc
Document behavior of `<dyn Any as Any>::type_id()` See also rust-lang#57893 `@rustbot` label A-docs T-libs
2 parents f38de06 + db62921 commit c3216e2

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)