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

Feature gate `&Void`'s uninhabitedness. #39151

Merged
merged 1 commit into from Jan 19, 2017

Conversation

Projects
None yet
7 participants
@canndrew
Copy link
Contributor

canndrew commented Jan 18, 2017

Here's a totally crazy PR which should never be merged.

Feature gate `&Void`'s uninhabitedness.
References to empty types are only considered empty if feature(never_type) is
enabled.
@canndrew

This comment has been minimized.

Copy link
Contributor Author

canndrew commented Jan 18, 2017

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 18, 2017

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@arielb1 arielb1 referenced this pull request Jan 18, 2017

Open

Tracking issue for promoting `!` to a type (RFC 1216) #35121

12 of 13 tasks complete
@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Jan 18, 2017

@bors r+ rollup

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 18, 2017

📌 Commit 2c6bc18 has been approved by arielb1

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Jan 18, 2017

The non-reference parts seem to be mostly uncontroversial, except for the issue that you can't have a match expression in a macro without risking unreachable code warnings. Not sure what is the best way to handle that. Macro reachability hygiene?

@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Jan 18, 2017

This will continue to work, right?

match void_ref_result {
    Err(e) => ... ,
    Ok(&r) => match r { },
}
@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Jan 18, 2017

Not sure what is the best way to handle that. Macro reachability hygiene?

allow unreachable annotation on arm?

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Jan 18, 2017

This will continue to work, right?

If it worked before the matchck changes, it should continue working.

allow unreachable annotation on arm?

The problem is that the change is an hygiene hazard - every match of a generic-containing enum in a macro has to be careful not to cause spurious unreachable arm errors. Maybe just disabling unreachable arm errors in cross-crate macros or something would work as a basic form of hygiene.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jan 18, 2017

@bors r+ p=1 beta fix

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 18, 2017

💡 This pull request was already approved, no need to approve it again.

  • There's another pull request that is currently being tested, blocking this pull request: #38842
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 18, 2017

📌 Commit 2c6bc18 has been approved by brson

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jan 18, 2017

@bors p=1

@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Jan 19, 2017

@arielb1 yeah, the current "unhygenic" approach is somewhat analogous to doing a post-monomorphization warning with generic functions. I feel like maybe you don't always want that to be ignored, but then a use-site "no---really----please warn/error" would suffice.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jan 19, 2017

This patch does not apply to beta - the inhabitedness mod does not exist. Is this really a beta backport?

@brson brson referenced this pull request Jan 19, 2017

Merged

Beta next #39170

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 19, 2017

@canndrew I just wanted to say thanks for turning this around so quickly.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 19, 2017

Rollup merge of rust-lang#39151 - canndrew:feature-gate-uninhabited-r…
…eferences, r=brson

Feature gate `&Void`'s uninhabitedness.

Here's a totally crazy PR which should never be merged.

bors added a commit that referenced this pull request Jan 19, 2017

Auto merge of #39180 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests

- Successful merges: #38457, #38922, #38970, #39039, #39091, #39115, #39121, #39149, #39150, #39151, #39165
- Failed merges:

@arielb1 arielb1 removed the beta-nominated label Jan 19, 2017

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Jan 19, 2017

@brson

No. it's a 1.16 issue only.

@bors bors merged commit 2c6bc18 into rust-lang:master Jan 19, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.