-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Implement the !
type
#35162
Merged
Merged
Implement the !
type
#35162
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ba7330c
Start implementation of RFC 1216 (make ! a type)
canndrew b0a9acd
Parse `!` as TyEmpty (except in fn return type)
canndrew 0d86361
Add EmptyToAny adjustment
canndrew c88c54e
Invoke coercions on !
canndrew 798f719
Add run-fail/adjust_empty.rs test
canndrew 533a389
Small optimization
canndrew 9f9f856
Fix rustdoc after rebase
canndrew 104963c
Switch on TyEmpty
canndrew f31d975
Fix super_relate_tys so that ! == !
canndrew 0829152
Make unused lint ignore unused `!`
canndrew ee78f37
impl Debug + Display for !
canndrew ed02344
Remove obsolete divergence related stuff
canndrew b22beed
Fix build after rebase to lastest master
canndrew 51c6ae2
implement std::cmp::* traits for `!`
canndrew ba65d2e
Remove invalid compile-fail tests related to `!`
canndrew 0e1c2aa
Make AdjustEmptyToAny actually perform the adjustment
canndrew 5096a8c
Control usage of `!` through a feature gate.
canndrew f0a8b6d
Minor fixups based on @eddyb's feedback
canndrew fadabe0
Rename empty/bang to never
canndrew 8010314
Un-improve Ty::is_uninabited
canndrew 54c72d8
Minor fix
canndrew 3639341
Default diverging types based on feature gate.
canndrew a6d6fff
Lookup node type in map rather than using write_ty_expr
canndrew 69e2761
Minor fixup.
canndrew f019a92
Correctly handle AdjustNeverToAny in try_find_coercion_lub
canndrew a05560b
Add run-pass/never_coercions.rs test
canndrew a4e6009
Minor fixups based on feedback
canndrew c6890e1
Revert Ty::is_uninhabited to its original state
canndrew 2eff282
Add some tests for ! type
canndrew 00a71ea
Add tests for ! type
canndrew 06747c6
Add another test for !
canndrew bcff5a7
Permit `! as T` with test
canndrew 29f3636
Add explanations to tests
canndrew 5bd54a2
Fix `make tidy`
canndrew 6b8dace
Improve comments on ! tests
canndrew ef1b507
Fix build after rebase
canndrew c3131f2
Fix bug in PostExpansionVisitor
canndrew 0add394
Remove diagnostic E0166
canndrew f59f1f0
Fix bug for ! in old trans
canndrew 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikomatsakis What do you think about these impls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure I added these out of necessity to make a test pass. Also
!
is trivially totally ordered so it should implOrd
.