rust/compiler/rustc_feature/src
Jacob Pratt 05f22c3614
Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of https://github.com/rust-lang/rust/pull/121501

cc #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: https://github.com/google/zerocopy/issues/941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-11 03:47:19 -04:00
..
accepted.rs Stabilize the #[diagnostic] namespace and #[diagnostic::on_unimplemented] attribute 2024-02-27 08:50:56 +01:00
builtin_attrs.rs diagnostics: Do not suggest using #[unix_sigpipe] without a value 2024-03-10 15:12:50 +01:00
lib.rs Replace NonZero::<_>::new with NonZero::new. 2024-02-15 08:09:42 +01:00
removed.rs remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics 2024-02-25 08:14:52 +01:00
tests.rs tidy: Re-enable check for inline unit tests 2020-12-12 19:18:44 +03:00
unstable.rs Rollup merge of #121840 - oli-obk:freeze, r=dtolnay 2024-03-11 03:47:19 -04:00