Skip to content
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

use matches!() macro in more places #90642

Merged
merged 1 commit into from
Nov 7, 2021

Conversation

matthiaskrgr
Copy link
Member

No description provided.

@rust-highfive
Copy link
Collaborator

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 6, 2021
compiler/rustc_mir_build/src/thir/pattern/check_match.rs Outdated Show resolved Hide resolved
ty::BoundConstness::ConstIfConst if self.is_in_const_context => true,
_ => false,
}
matches!(pred.constness, ty::BoundConstness::ConstIfConst if self.is_in_const_context)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
matches!(pred.constness, ty::BoundConstness::ConstIfConst if self.is_in_const_context)
matches!(pred.constness, ty::BoundConstness::ConstIfConst) && self.is_in_const_context

@cjgillot cjgillot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2021
| Ok(Some(ImplSource::Param(_, ty::BoundConstness::ConstIfConst))) => false,
_ => true,
}
| Ok(Some(ImplSource::Param(_, ty::BoundConstness::ConstIfConst)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a candidate for "interior patterns": Ok(Some(ImplSource::ConstDrop(_) | ImplSource::Param(...)))

@matthiaskrgr
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 6, 2021
@cjgillot
Copy link
Contributor

cjgillot commented Nov 6, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 6, 2021

📌 Commit 0a5640b has been approved by cjgillot

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 6, 2021
…llot

use matches!() macro in more places
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 6, 2021
…askrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#90487 (Add a chapter on reading Rustdoc output)
 - rust-lang#90508 (Apply adjustments for field expression even if inaccessible)
 - rust-lang#90627 (Suggest dereference of `Box` when inner type is expected)
 - rust-lang#90642 (use matches!() macro in more places)
 - rust-lang#90646 (type error go brrrrrrrr)
 - rust-lang#90649 (Run reveal_all on MIR when inlining is activated.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5f0e6ca into rust-lang:master Nov 7, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 7, 2021
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 5, 2021
Enable rustbot shortcuts for rust-clippy

This enables shortcuts for ``@rustbot`.` Just a quality of life feature for contributors.

|Shortcut| Full comment |
|---|---|
| ``@rustbot` ready` | ``@rustbot` label -S-waiting-on-author +S-waiting-on-review` |
| ``@rustbot` author` | ``@rustbot` label +S-waiting-on-author -S-waiting-on-review` |

See: https://github.com/rust-lang/triagebot/wiki/Shortcuts

The documentation also states that the author/assignee will be pinged. However, this doesn't seem to be the case, it at least hasn't done so for me and in this [PR](rust-lang/rust#90642 (comment))

---

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants