We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TypeId
1 parent 292db4a commit 460e92eCopy full SHA for 460e92e
library/core/src/any.rs
@@ -611,6 +611,17 @@ impl dyn Any + Send + Sync {
611
/// noting that the hashes and ordering will vary between Rust releases. Beware
612
/// of relying on them inside of your code!
613
///
614
+/// # Layout
615
+///
616
+/// The size of `TypeId` is guaranteed not to exceed 16 bytes.
617
618
+/// ```rust
619
+/// # #![feature(assert_matches)]
620
+/// # use std::any::TypeId;
621
+/// # use std::assert_matches::assert_matches;
622
+/// assert_matches!(size_of::<TypeId>(), 1..=16);
623
+/// ```
624
625
/// # Danger of Improper Variance
626
627
/// You might think that subtyping is impossible between two static types,
0 commit comments