Allow ! as the return type of proc/closure literals#16836
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 17, 2014
Merged
Allow ! as the return type of proc/closure literals#16836bors merged 2 commits intorust-lang:masterfrom
! as the return type of proc/closure literals#16836bors merged 2 commits intorust-lang:masterfrom
Conversation
Member
|
This may be a very untested part of the compiler (as it may have never been exercised before), so it would be nice to see a larger array of tests to ensure that this feature does indeed work. Some things such as:
|
Contributor
Author
|
There’s already some testing for this: |
Contributor
|
More tests I would like:
|
Contributor
Author
|
I think |
c84cb8d to
e5bbbbe
Compare
bors
added a commit
that referenced
this pull request
Sep 17, 2014
ehuss
added a commit
to ehuss/rust
that referenced
this pull request
Apr 15, 2023
This test was ignored long ago in rust-lang#20578 when the syntax for closures was changed. The current status is that a closure with an explicit `!` return type will trigger the `unreachable_code` lint which appears to be the original intent of the test (rust-lang#16836). A closure without a return type won't trigger the lint since the `!` type isn't inferred (AFAIK). This restores the test to its original form.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #13490.