Expose the Freeze
trait again (unstably) and forbid implementing it manually by oli-obk · Pull Request #121501 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
The head ref may contain hidden characters: "\u{1F976}"
Conversation24 Commits250 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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
r? libs-api
Open questions
- naming: Could also have a name that contains
Cell
, as the trait signals the absence ofUnsafeCell
.
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to the library team, which will review and decide on the PR/issue.
labels
This comment has been minimized.
I broke github :( I already pushed to this branch, but it hasn't updated in two hours
Some changes occurred in compiler/rustc_codegen_gcc
Some changes occurred in compiler/rustc_codegen_cranelift
cc @bjorn3
This comment has been minimized.
This comment has been minimized.
In auxiliary/sigpipe-utils.rs
, all we want to know is the current
SIGPIPE
disposition. We should not change it. So use libc::sigaction
instead of libc::signal
. That way we can also remove the code that
restores it.
This allows for Windows users to use miri-script without pain
Windows miri-script execution egronomics
This allows for Windows users to use miri-script without pain. As working on miri earlier I was doing
.\miri-script\target\debug\miri-script.exe { install | build | ... }
which wasn't fun.
Add "cargo miri clean" command
My first reaction when my miri cache was messed up was to attempt run this, which obviously failed. This helps paper over platform differences and such.
compiler: clippy::complexity fixes
compiletest: call cargo-miri directly rather than via 'cargo run'
Fixes rust-lang/miri#3297. Thanks to @bjorn3
for figuring out the cause of this.
r? @oli-obk
Co-authored-by: Ben Kimock kimockb@gmail.com
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#121435 (Account for RPITIT in E0310 explicit lifetime constraint suggestion)
- rust-lang#121490 (Rustdoc: include crate name in links for local primitives)
- rust-lang#121520 (delay cloning of iterator items)
- rust-lang#121522 (check that simd_insert/extract indices are in-bounds)
- rust-lang#121531 (Ignore less tests in debug builds)
- rust-lang#121539 (compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move)
- rust-lang#121542 (update stdarch)
r? @ghost
@rustbot
modify labels: rollup
…slice, r=Mark-Simulacrum
Add examples for some methods on slices
Adds some examples to some methods on slice.
is_empty
didn't have an example for an empty slice, even though str
and the collections all have one, so I added that in.
first_mut
and last_mut
didn't have an example for what happens when the slice is empty, whereas first
and last
do, so I added that too.
…wjasper
match lowering: Split off test_candidates
into several functions and improve comments
The logic of test_candidates
has three steps: pick a test, sort the candidates, and generate code for everything. So I split it off into three methods.
I also ended up reworking the comments that explain the algorithm. In particular I added detailed examples. I removed the digression about rust-lang#29740 because it's no longer relevant to how the code is structured today.
r? @matthewjasper
…on, r=Mark-Simulacrum
Ignore compiletest test directive migration commits
Not sure if the corresponding bors commit need to be included as well, assuming not.
…-obk
promotion: don't promote int::MIN / -1
Looks like I entirely forgot about this case when adding the div-by-zero check, which was supposed to ensure that we never promote operations that can fail... Cc rust-lang#80619
This is a breaking change, so needs a crater run.
r? @oli-obk
Fix incorrect doc of ScopedJoinHandle::is_finished
Fixes the explanation how to use is_finished
to achieve a non-blocking join. The updated version matches the documentation of the non-scoped JoinHandle::is_finished.
Forbid use of extern "C-unwind"
inside standard library
Those libraries are build with -C panic=unwind
and is expected to be linkable to -C panic=abort
library. To ensure unsoundness compiler needs to prevent a C-unwind
call to exist, as doing so may leak foreign exceptions into -C panic=abort
.
r? @RalfJung
Operating System: Hermit
Target: SGX
Operating system: Unix-like
Operating system: Wasi, Webassembly System Interface
Operating system: Windows
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Relevant to the infrastructure team, which will review and decide on the PR/issue.
The Rustc Trait System Refactor Initiative (-Znext-solver)
labels
This comment was marked as resolved.
This comment has been minimized.
triagebot.toml
has been modified, there may have been changes to the review queue.
Some changes occurred in engine.rs, potentially modifying the public API of ObligationCtxt
.
At this point I have to assume that GitHub chokes on the emoji branch name. It takes 3h to accept a force push, and I am certain the branch is correctly based off master
You could also try filing a new one (with fewer than 1000 commits).
Yea, must be the emoji 💀
I opened #121840 at the same commit as this PR, and it works just fine ™️
jhpratt added a commit to jhpratt/rust that referenced this pull request
Expose the Freeze trait again (unstably) and forbid implementing it manually
non-emoji version of rust-lang#121501
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 pull request
Expose the Freeze trait again (unstably) and forbid implementing it manually
non-emoji version of rust-lang#121501
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 pull request
Expose the Freeze trait again (unstably) and forbid implementing it manually
non-emoji version of rust-lang#121501
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 pull request
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
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 pull request
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 pull request
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 pull request
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)
Labels
Area: Issues & PRs about the rust-lang/rust repository itself
Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)
Area: The testsuite used to check the correctness of rustc
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
PR has merge commits, merge with caution.
Operating System: Hermit
Target: SGX
Operating system: Unix-like
Operating system: Wasi, Webassembly System Interface
Operating system: Windows
Status: This is awaiting some action (such as code changes or more information) from the author.
Status: Awaiting review from the assignee but also interested parties.
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to the infrastructure team, which will review and decide on the PR/issue.
Relevant to the language team, which will review and decide on the PR/issue.
Relevant to the library team, which will review and decide on the PR/issue.
The Rustc Trait System Refactor Initiative (-Znext-solver)