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

Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks #56110

Merged
merged 5 commits into from
Dec 3, 2018

Conversation

varkor
Copy link
Member

@varkor varkor commented Nov 20, 2018

It isn't settled exactly how references to uninhabited types and unions of uninhabited types should act, but we should be more conservative here, as it's likely it will be permitted to soundly have values of such types.

This will also be more important in light of the changes at #54125.

cc @RalfJung

@rust-highfive
Copy link
Collaborator

r? @cramertj

(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 20, 2018
@RalfJung
Copy link
Member

Is it possible to write tests that show examples of how this changes things?

@cramertj
Copy link
Member

r=me with a test added.

@rust-highfive

This comment has been minimized.

@varkor
Copy link
Member Author

varkor commented Nov 20, 2018

I've added a test and removed one that I don't think should apply any more, because the infinite type errors kick in before the infinite uninhabitedness checking ones (as references were the only way to cause this kind of infinite checking).

src/librustc/ty/inhabitedness/mod.rs Show resolved Hide resolved
src/librustc/ty/inhabitedness/mod.rs Show resolved Hide resolved
src/test/ui/always-inhabited-union-ref.rs Show resolved Hide resolved
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@varkor varkor force-pushed the inhabitedness-union-enum branch from 1b3e434 to 3de817c Compare November 21, 2018 00:44
@varkor
Copy link
Member Author

varkor commented Nov 21, 2018

@cramertj: this required changing a few tests in the end, so it'd be great if you could re-check the changes!

@cramertj
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 21, 2018

📌 Commit 3de817cf07ecef20732504ee0a903d2cdceda0b6 has been approved by cramertj

@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 21, 2018
@pietroalbini
Copy link
Member

@bors r-

Failed in the rollup

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 28, 2018
@varkor varkor force-pushed the inhabitedness-union-enum branch from 3de817c to 1cdf5df Compare November 29, 2018 21:00
@varkor
Copy link
Member Author

varkor commented Nov 29, 2018

@bors r=cramertj

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 1, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 1, 2018
…cramertj

Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks

It isn't settled exactly how references to uninhabited types and unions of uninhabited types should act, but we should be more conservative here, as it's likely it will be permitted to soundly have values of such types.

This will also be more important in light of the changes at rust-lang#54125.

cc @RalfJung
bors added a commit that referenced this pull request Dec 1, 2018
Rollup of 9 pull requests

Successful merges:

 - #55010 (Add template parameter debuginfo to generic types)
 - #56110 (Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks)
 - #56305 (update miri)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56394 (Deal with EINTR in net timeout tests)
 - #56395 (Stabilize dbg!(...))
 - #56402 (Improve the unstable book example for #56408 [marker] trait)
 - #56406 (Update RLS and Rustfmt)
 - #56366 (Stabilize self_in_typedefs feature)

Failed merges:

r? @ghost
@Centril
Copy link
Contributor

Centril commented Dec 1, 2018

@varkor Same error seems to have turned up in #56408 (comment) which included this PR.

@nikic
Copy link
Contributor

nikic commented Dec 1, 2018

@Centril This is a spurious failure introduced by #49878, with a fix at #56396. It's unrelated to this PR :)

@Centril
Copy link
Contributor

Centril commented Dec 1, 2018

@bors rollup

(was in #56408)

Centril added a commit to Centril/rust that referenced this pull request Dec 1, 2018
…cramertj

Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks

It isn't settled exactly how references to uninhabited types and unions of uninhabited types should act, but we should be more conservative here, as it's likely it will be permitted to soundly have values of such types.

This will also be more important in light of the changes at rust-lang#54125.

cc @RalfJung
@dlrobertson
Copy link
Contributor

#56396 landed... Thanks for you patience, this is probably due for a retry

@varkor
Copy link
Member Author

varkor commented Dec 2, 2018

@bors retry

Centril added a commit to Centril/rust that referenced this pull request Dec 2, 2018
…cramertj

Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks

It isn't settled exactly how references to uninhabited types and unions of uninhabited types should act, but we should be more conservative here, as it's likely it will be permitted to soundly have values of such types.

This will also be more important in light of the changes at rust-lang#54125.

cc @RalfJung
bors added a commit that referenced this pull request Dec 2, 2018
Rollup of 14 pull requests

Successful merges:

 - #56110 (Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks)
 - #56305 (update miri)
 - #56366 (Stabilize self_in_typedefs feature)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56394 (Deal with EINTR in net timeout tests)
 - #56395 (Stabilize dbg!(...))
 - #56401 (Move VecDeque::resize_with out of the impl<T:Clone> block)
 - #56402 (Improve the unstable book example for #[marker] trait)
 - #56412 (Update tracking issue for `extern_crate_self`)
 - #56416 (Remove unneeded body class selector)
 - #56418 (Fix failing tidy (line endings on Windows))
 - #56419 (Remove some uses of try!)
 - #56424 (Mention raw-ident syntax)
 - #56432 (Update issue number of `shrink_to` methods to point the tracking issue)

Failed merges:

r? @ghost
@pietroalbini
Copy link
Member

@bors rollup-

@bors
Copy link
Contributor

bors commented Dec 2, 2018

⌛ Testing commit 1cdf5df with merge b817d0b...

bors added a commit that referenced this pull request Dec 2, 2018
Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks

It isn't settled exactly how references to uninhabited types and unions of uninhabited types should act, but we should be more conservative here, as it's likely it will be permitted to soundly have values of such types.

This will also be more important in light of the changes at #54125.

cc @RalfJung
@bors
Copy link
Contributor

bors commented Dec 3, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: cramertj
Pushing b817d0b to master...

@bors bors merged commit 1cdf5df into rust-lang:master Dec 3, 2018
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.

9 participants