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 }})

oli-obk

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

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Feb 23, 2024

@rust-log-analyzer

This comment has been minimized.

asquared31415

@oli-obk

I broke github :( I already pushed to this branch, but it hasn't updated in two hours

jswrenn

@rustbot

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Enselic

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.

@GrigorenkoPV

@RossSmyth

This allows for Windows users to use miri-script without pain

@bors

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.

@rsmyth-ecmi @RossSmyth

@RalfJung

@bors

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.

@bors

compiler: clippy::complexity fixes

@bors

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

@Noratrieb @saethlin

Co-authored-by: Ben Kimock kimockb@gmail.com

@ChrisDenton

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

@matthiaskrgr

…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.

@matthiaskrgr

…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

@matthiaskrgr

…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.

@matthiaskrgr

…-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

@matthiaskrgr

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.

@matthiaskrgr

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

@rustbot rustbot added O-hermit

Operating System: Hermit

O-SGX

Target: SGX

O-unix

Operating system: Unix-like

O-wasi

Operating system: Wasi, Webassembly System Interface

O-windows

Operating system: Windows

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

T-infra

Relevant to the infrastructure team, which will review and decide on the PR/issue.

WG-trait-system-refactor

The Rustc Trait System Refactor Initiative (-Znext-solver)

labels

Feb 29, 2024

@rustbot

This comment was marked as resolved.

@oli-obk

@rust-log-analyzer

This comment has been minimized.

@oli-obk

@oli-obk

@rustbot

triagebot.toml has been modified, there may have been changes to the review queue.

cc @davidtwco, @wesleywiser

Some changes occurred in engine.rs, potentially modifying the public API of ObligationCtxt.

cc @lcnr, @compiler-errors

@rustbot

@oli-obk

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

@lnicola

You could also try filing a new one (with fewer than 1000 commits).

@oli-obk

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

Mar 10, 2024

@jhpratt

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 pull request

Mar 11, 2024

@jhpratt

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 pull request

Mar 11, 2024

@jhpratt

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 pull request

Mar 11, 2024

@rust-timer

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 pull request

Mar 12, 2024

@jhpratt

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

Mar 16, 2024

@jhpratt

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

Mar 26, 2024

@jhpratt

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

A-meta

Area: Issues & PRs about the rust-lang/rust repository itself

A-query-system

Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)

A-testsuite

Area: The testsuite used to check the correctness of rustc

A-translation

Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic

has-merge-commits

PR has merge commits, merge with caution.

O-hermit

Operating System: Hermit

O-SGX

Target: SGX

O-unix

Operating system: Unix-like

O-wasi

Operating system: Wasi, Webassembly System Interface

O-windows

Operating system: Windows

S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

T-infra

Relevant to the infrastructure team, which will review and decide on the PR/issue.

T-lang

Relevant to the language team, which will review and decide on the PR/issue.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

WG-trait-system-refactor

The Rustc Trait System Refactor Initiative (-Znext-solver)