-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
The never type can be named despite its feature gate #58733
Comments
This case can be reduced to the following: fn foo() -> ! {
unimplemented!()
} which is as a result of this rust/src/libsyntax/feature_gate.rs Lines 1825 to 1833 in b57fe74
This was intentionally added in 4d1a30c. |
@varkor that on its own is just a diverging function, which has been supported since Rust 1.0.0 (and probably long before). |
@Nemo157: ah, I see. Originally, diverging functions were separate from the never type, but since they became unified, there's nothing to distinguish a diverging function from a function returning never. It seems unavoidable to have |
Idea: Could we emit a warning when encounter constructs such as the one in the issue description? |
I'm curious what we can/should consider the bug here to be. Specifically, in the absence of (And maybe this question is going to be made irrelevant so soon that it need not be answered...) |
Ah yes I think my previous question is made obsolete by PR #65355 |
Is this issue relevant again because of #67224? |
@pnkfelix that doesn't look like it would be that much better, because then people could also write Given the current situation with |
Reported by @xfix in #33417 (comment).
The never type is unstable (#35121) but the code above (which doesn’t use any feature gate) compiles in Rust 1.12.0 (which I think is the first with #35162), 1.32.0, and 1.34.0-nightly (aadbc45 2019-02-23). In 1.11.0, it errors with:
The text was updated successfully, but these errors were encountered: