-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
unreachable_code
lint doesn't work with unboxed closures
#20574
Comments
AFAICT, it seems that the first closure is defaulting to have return type (Maybe that's what we should regard as a bug?) |
I think it would be quite interesting for |
@japaric what happens if you explicitly annotate the return type of the unboxed closure to be |
let uc = |&:| -> ! panic!();
uc(); ICEs with |
Well, that's unfortunate. It's apparently illegal to use pub trait X<T> {}
pub struct Foo;
impl X<!> for Foo {}
fn main() {} errors with |
Triage: updated code:
and
The former still compiles, while the latter doesn't.
This would seem to be the case. @rust-lang/lang , what are the semantics we want here? |
We no longer support closures with |
(see also #14973 and rust-lang/rfcs#1001 for related discussion of whether one would want |
Sounds good to me, thanks! |
Should this be re-opened @nikomatsakis ? The type system can now handle rust/src/test/compile-fail/dead-code-closure-bang.rs Lines 13 to 19 in b1363a7
|
This compiles, but it shouldn't
This is correctly rejected
version:
rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)
The text was updated successfully, but these errors were encountered: