Skip to content

Commit

Permalink
warn against implementing Freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 31, 2024
1 parent c93b17d commit 5143221
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,11 @@ pub trait DiscriminantKind {
/// 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.
///
/// This trait is a core part of the language, it just just expressed as a trait in libcore for
/// convenience. Do *not* implement it for other types.
// FIXME: Eventually this trait should become `#[rustc_deny_explicit_impl]`.
// That requires porting the impls below to native internal impls.
#[lang = "freeze"]
#[unstable(feature = "freeze", issue = "121675")]
pub unsafe auto trait Freeze {}
Expand Down

0 comments on commit 5143221

Please sign in to comment.