diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2024-04-04 21:16:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-04 21:16:55 -0400 |
| commit | de2cb0d76c79720eb641e3ebbacf26907eac69dc (patch) | |
| tree | 420e46b2ec1b1d650bf7b53594b03f05a34b7019 /library/core/src/ptr | |
| parent | 385fa9d845dd326c6bbfd58c22244215e431948a (diff) | |
| parent | 8f5a28e0aa3a84aa105c66acec58684a2550b73a (diff) | |
Rollup merge of #123206 - stepancheg:pointee-metadata-freeze, r=Amanieu
Require Pointee::Metadata to be Freeze So pointee metadata can be used in anonymous statics. This is prerequisite for implementing ThinBox without allocation for ZST. See https://github.com/rust-lang/rust/pull/123184#discussion_r1544627488 r? joboet
Diffstat (limited to 'library/core/src/ptr')
| -rw-r--r-- | library/core/src/ptr/metadata.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs index 9b5da935e07..25a06f121cd 100644 --- a/library/core/src/ptr/metadata.rs +++ b/library/core/src/ptr/metadata.rs @@ -2,6 +2,7 @@ use crate::fmt; use crate::hash::{Hash, Hasher}; +use crate::marker::Freeze; /// Provides the pointer metadata type of any pointed-to type. /// @@ -57,7 +58,7 @@ pub trait Pointee { // NOTE: Keep trait bounds in `static_assert_expected_bounds_for_metadata` // in `library/core/src/ptr/metadata.rs` // in sync with those here: - type Metadata: fmt::Debug + Copy + Send + Sync + Ord + Hash + Unpin; + type Metadata: fmt::Debug + Copy + Send + Sync + Ord + Hash + Unpin + Freeze; } /// Pointers to types implementing this trait alias are “thin”. |
