Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions library/core/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,14 @@ impl dyn Any + Send + Sync {
///
/// # Layout
///
/// Like other [`Rust`-representation][repr-rust] types, `TypeId`'s size and layout are unstable.
/// In particular, this means that you cannot rely on the size and layout of `TypeId` remaining the
/// same between Rust releases; they are subject to change without prior notice between Rust
/// releases.
/// The size of `TypeId` is guaranteed not to exceed 16 bytes.
///
/// [repr-rust]: https://doc.rust-lang.org/reference/type-layout.html#r-layout.repr.rust.unspecified
/// This is the only guarantee given; any other layout or implementation details
/// are unstable and prone to change between Rust releases without prior notice.
///
/// ```
/// assert!(size_of::<std::any::TypeId>() <= 16);
/// ```
///
/// # Danger of Improper Variance
///
Expand Down Expand Up @@ -714,6 +716,7 @@ impl dyn Any + Send + Sync {
/// std::mem::forget(fake_one_ring);
/// }
/// ```
#[repr(C)]
#[derive(Copy, PartialOrd, Ord)]
#[derive_const(Clone, Eq)]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
Loading