warn against implementing Freeze
This commit is contained in:
parent
c93b17d6d2
commit
602401c4d4
1 changed files with 7 additions and 0 deletions
|
@ -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 {}
|
||||
|
|
Loading…
Add table
Reference in a new issue