Skip to content

Commit

Permalink
Rollup merge of #123268 - RalfJung:dont-freeze, r=Nilstrieb
Browse files Browse the repository at this point in the history
warn against implementing Freeze

As [requested](#123184 (comment)) by `@workingjubilee`
  • Loading branch information
workingjubilee committed Mar 31, 2024
2 parents 2a08f02 + 602401c commit 9ff4c70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,13 @@ 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.
///
/// # Safety
///
/// This trait is a core part of the language, it is 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 9ff4c70

Please sign in to comment.