-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
impl Not for ! #91122
impl Not for ! #91122
Conversation
Currently fails to build: error[E0600]: cannot apply unary operator `!` to type `!` --> library/core/tests/ops.rs:239:8 | 239 | if !return () {} | ^^^^^^^^^^ cannot apply unary operator `!`
It looks like highfive hasn't assigned this. |
This comment has been minimized.
This comment has been minimized.
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Nominating for the lang team because the libs-api team would like to check whether lang considers it a lang matter if we add impls of traits for Note in particular that this will be visible in stable. |
Is this the first trait impl on
So I don't really have any particular concern here, but this seems like it's setting a precedent for other things -- does If there was going to be a lang thing here, it could be that the type checker just was smart about |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Regarding |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@bors r+ |
📌 Commit 3136c5f has been approved by |
impl Not for ! The lack of this impl caused trouble for me in some degenerate cases of macro-generated code of the form `if !$cond {...}`, even without `feature(never_type)` on a stable compiler. Namely if `$cond` contains a `return` or `break` or similar diverging expression, which would otherwise be perfectly legal in boolean position, the code previously failed to compile with: ```console error[E0600]: cannot apply unary operator `!` to type `!` --> library/core/tests/ops.rs:239:8 | 239 | if !return () {} | ^^^^^^^^^^ cannot apply unary operator `!` ```
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#90666 (Stabilize arc_new_cyclic) - rust-lang#91122 (impl Not for !) - rust-lang#93068 (Fix spacing for `·` between stability and source) - rust-lang#93103 (Tweak `expr.await` desugaring `Span`) - rust-lang#93113 (Unify search input and buttons size) - rust-lang#93168 (update uclibc instructions for new toolchain, add link from platforms doc) - rust-lang#93185 (rustdoc: Make some `pub` items crate-private) - rust-lang#93196 (Remove dead code from build_helper) Failed merges: - rust-lang#93188 (rustdoc: fix bump down typing search on Safari) r? `@ghost` `@rustbot` modify labels: rollup
The lack of this impl caused trouble for me in some degenerate cases of macro-generated code of the form
if !$cond {...}
, even withoutfeature(never_type)
on a stable compiler. Namely if$cond
contains areturn
orbreak
or similar diverging expression, which would otherwise be perfectly legal in boolean position, the code previously failed to compile with: