Skip to content

Commit a6202e2

Browse files
authored
Rollup merge of rust-lang#121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually non-emoji version of rust-lang#121501 cc rust-lang#60715 This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue. It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: google/zerocopy#941 cc ```@RalfJung``` T-lang signed off on reexposing this unstably: rust-lang#121501 (comment)
2 parents 0031b21 + 3ca0c59 commit a6202e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example/mini_core.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(
22
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
3-
decl_macro, rustc_attrs, transparent_unions, auto_traits,
3+
decl_macro, rustc_attrs, transparent_unions, auto_traits, freeze_impls,
44
thread_local
55
)]
66
#![no_core]

0 commit comments

Comments
 (0)