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

Allow Unreachable terminators through min_const_fn checks #66788

Merged
merged 3 commits into from
Nov 27, 2019

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented Nov 26, 2019

Resolves #66756.

This allows Unreachable terminators through the min_const_fn checks if #![feature(const_if_match)] is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 26, 2019
@ecstatic-morse ecstatic-morse changed the title Const fn unreachable Allow Unreachable terminators through min_const_fn checks Nov 26, 2019
@Centril
Copy link
Contributor

Centril commented Nov 26, 2019

Resolves #66786.

Home come? Seems good to me for that PR to land.

Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

r=me if you like, or wait for Oliver's review; up to you :)

@ecstatic-morse
Copy link
Contributor Author

ecstatic-morse commented Nov 26, 2019

Oh I meant #66758 (I use keyword completion to reference github issues). I didn't see someone was trying to work on it. In a perfect world these tests would live together, but it's not terribly important. I'll remove the test from this one?

@Centril
Copy link
Contributor

Centril commented Nov 26, 2019

I'll remove the test from this one?

Sure, why not; you could also wait and rebase -- up to you :)

@ecstatic-morse
Copy link
Contributor Author

@bors r=Centril

@jyn514 it would be nice to merge your test into this one at some point in the future.

@bors
Copy link
Contributor

bors commented Nov 26, 2019

📌 Commit a626bf6 has been approved by Centril

@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 26, 2019
tmandry added a commit to tmandry/rust that referenced this pull request Nov 26, 2019
…, r=Centril

Allow `Unreachable` terminators through `min_const_fn` checks

Resolves rust-lang#66756.

This allows `Unreachable` terminators through the `min_const_fn` checks if `#![feature(const_if_match)]` is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here.

r? @oli-obk
bors added a commit that referenced this pull request Nov 27, 2019
Rollup of 14 pull requests

Successful merges:

 - #66128 (alloc: Add new_zeroed() versions like new_uninit().)
 - #66661 (Add riscv64gc-unknown-linux-gnu target)
 - #66663 (Miri: print leak report even without tracing)
 - #66711 (Add hardware floating point features to aarch64-pc-windows-msvc)
 - #66713 (introduce a target to build the kernel of the unikernel HermitCore)
 - #66717 (tidy: Accommodate rustfmt's preferred layout of stability attributes)
 - #66719 (Store pointer width as u32 on Config)
 - #66720 (Move ErrorReported to rustc_errors)
 - #66737 (Error codes cleanup)
 - #66754 (Various tweaks to diagnostic output)
 - #66763 (Minor edit for documentation-tests.md that increases clarity)
 - #66779 (follow the same function order in the trait)
 - #66786 (Add wildcard test for const_if_match)
 - #66788 (Allow `Unreachable` terminators through `min_const_fn` checks)

Failed merges:

r? @ghost
@bors bors merged commit a626bf6 into rust-lang:master Nov 27, 2019
jyn514 added a commit to jyn514/rust that referenced this pull request Nov 27, 2019
tmandry added a commit to tmandry/rust that referenced this pull request Nov 27, 2019
…=Dylan-DPC

Combine similar tests for const match

See rust-lang#66788 (comment) for context.
@ecstatic-morse ecstatic-morse deleted the const-fn-unreachable branch October 6, 2020 01:42
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.

Matching on exhaustive enum errors with const_if_match
5 participants