Skip to content

Commit 5143221

Browse files
committed
warn against implementing Freeze
1 parent c93b17d commit 5143221

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/core/src/marker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,11 @@ pub trait DiscriminantKind {
817817
/// This can be used to declare that a constant with a generic type
818818
/// will not contain interior mutability, and subsequently allow
819819
/// placing the constant behind references.
820+
///
821+
/// This trait is a core part of the language, it just just expressed as a trait in libcore for
822+
/// convenience. Do *not* implement it for other types.
823+
// FIXME: Eventually this trait should become `#[rustc_deny_explicit_impl]`.
824+
// That requires porting the impls below to native internal impls.
820825
#[lang = "freeze"]
821826
#[unstable(feature = "freeze", issue = "121675")]
822827
pub unsafe auto trait Freeze {}

0 commit comments

Comments
 (0)