diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-02-23 11:53:25 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-02-29 13:55:11 +0000 |
| commit | f030d49536cf821a062ecc48497e027f7dbf2767 (patch) | |
| tree | 9e2875fd973120400bba1d376595600fb20b0840 /library/core | |
| parent | 71a7b66f20c551f640f2f382bc7e7923ba0a5dab (diff) | |
| download | rust-f030d49536cf821a062ecc48497e027f7dbf2767.tar.gz rust-f030d49536cf821a062ecc48497e027f7dbf2767.zip | |
Expose `Freeze` trait again
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/marker.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 2e22129d7b6..c5cacd12f70 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -810,15 +810,21 @@ pub trait DiscriminantKind { type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin; } -/// Compiler-internal trait used to determine whether a type contains +/// Used to determine whether a type contains /// any `UnsafeCell` internally, but not through an indirection. /// This affects, for example, whether a `static` of that type is /// placed in read-only static memory or writable static memory. +/// This can be used to declare that a constant with a generic type +/// will not contain interior mutability, and subsequently allow +/// placing the constant behind references. #[lang = "freeze"] -pub(crate) unsafe auto trait Freeze {} +#[unstable(feature = "freeze", issue = "60715")] +pub unsafe auto trait Freeze {} +#[unstable(feature = "freeze", issue = "60715")] impl<T: ?Sized> !Freeze for UnsafeCell<T> {} marker_impls! { + #[unstable(feature = "freeze", issue = "60715")] unsafe Freeze for {T: ?Sized} PhantomData<T>, {T: ?Sized} *const T, |
