-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Less conservative uninhabitedness check #54125
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
Merged
bors
merged 23 commits into
rust-lang:master
from
varkor:less-conservative-uninhabitedness-check
Dec 21, 2018
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
62b3590
Check for uninhabitedness instead of never
varkor 88afbf2
Make uninhabitedness checking more intelligent
varkor ffce4fb
Update uninhabited matches tests
varkor 64c2a31
Address comments
varkor 9f609f9
Fix Ref inhabitedness comment
varkor 4c88be3
Fix handling of divergent dicriminants
varkor 419d2d8
Update const eval uninhabited messages
varkor d065a49
Nonempty arrays of uninhabited arrays are Abi::Uninhabited
varkor 51e1c64
conservative_is_uninhabited implies abi.is_uninhabited
varkor 6e5e54f
Use unions for uninhabitedness checking rather than mem::transmute
varkor a38ff37
Improve `conservative_is_uninhabited` comment
varkor 13af92f
Add note on nonzero-sized uninhabited types
varkor 9c66599
Address unused variables warning with TcpStream
varkor cb4bd5a
Update ub-uninhabit tests
varkor 20415af
Add privately uninhabited dead code test
varkor 210e234
Make liveness analysis respect privacy
varkor 4d8a6ea
Fix some misbehaving tests
varkor 6561732
Consider privacy in more locations
varkor 3dd5034
Restore old match behaviour
varkor 19ea2d1
Add a mir-opt test
varkor 573c1ff
Add a FIXME for mir build unreachable destination checking
varkor 2ba3e66
Update tests
varkor 0a8b696
Remove nil-enum test
varkor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#![feature(never_type)] | ||
|
||
pub enum Void {} | ||
|
||
#[no_mangle] | ||
pub fn process_never(input: *const !) { | ||
let _input = unsafe { &*input }; | ||
} | ||
|
||
#[no_mangle] | ||
pub fn process_void(input: *const Void) { | ||
let _input = unsafe { &*input }; | ||
// In the future, this should end with `unreachable`, but we currently only do | ||
// unreachability analysis for `!`. | ||
} | ||
|
||
fn main() {} | ||
|
||
// END RUST SOURCE | ||
// | ||
// START rustc.process_never.SimplifyLocals.after.mir | ||
// bb0: { | ||
// StorageLive(_2); | ||
// _2 = &(*_1); | ||
// StorageDead(_2); | ||
// unreachable; | ||
// } | ||
// END rustc.process_never.SimplifyLocals.after.mir | ||
// | ||
// START rustc.process_void.SimplifyLocals.after.mir | ||
// bb0: { | ||
// StorageLive(_2); | ||
// _2 = &(*_1); | ||
// StorageDead(_2); | ||
// return; | ||
// } | ||
// END rustc.process_void.SimplifyLocals.after.mir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.