-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leverage core::marker::Freeze
#941
Comments
11 tasks
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Mar 10, 2024
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)
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Mar 11, 2024
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)
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Mar 11, 2024
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)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 11, 2024
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)
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this issue
Mar 12, 2024
Expose the Freeze trait again (unstably) and forbid implementing it manually non-emoji version of rust-lang/rust#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: google/zerocopy#941 cc ```@RalfJung``` T-lang signed off on reexposing this unstably: rust-lang/rust#121501 (comment)
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this issue
Mar 16, 2024
Expose the Freeze trait again (unstably) and forbid implementing it manually non-emoji version of rust-lang/rust#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: google/zerocopy#941 cc ```@RalfJung``` T-lang signed off on reexposing this unstably: rust-lang/rust#121501 (comment)
GuillaumeGomez
pushed a commit
to GuillaumeGomez/rustc_codegen_gcc
that referenced
this issue
Mar 26, 2024
Expose the Freeze trait again (unstably) and forbid implementing it manually non-emoji version of rust-lang/rust#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: google/zerocopy#941 cc ```@RalfJung``` T-lang signed off on reexposing this unstably: rust-lang/rust#121501 (comment)
We've decided that our |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With rust-lang/rust#121501, Rust may expose and subsequently stabilize the
Freeze
trait, which is automatically implemented for all types free ofUnsafeCell
(excluding by indirection such as&UnsafeCell
). This is analogous to ourNoCell
trait, but our trait must be explicitly derived.Once
Freeze
is stabilized, we should first emit abound on the definition of
NoCell
when zerocopy is compiled with sufficiently-recent toolchains.Then, we should consider whether to eliminate our
NoCell
trait altogether in favor of re-exportingFreeze as NoCell
.The text was updated successfully, but these errors were encountered: