-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
ICE with unboxed and diverging closure #20105
Comments
Bumping, I have a slightly longer example on the playpen. |
Annotating the closure to return the divergent type causes an ICE, as well: fn main() {
std::task::spawn(move || -> ! { panic!("A") });
}
|
Oh; adding the return-type to the closure (e.g: |
OK, I didn't think about adding a return type to the closure due to my misunderstanding of the bottom type in Rust. The trick of adding I'll reuse this issue for the above ICE. |
Minimal case: fn f<F, R>(_: F) where F: Fn<(), R> {
}
fn main() {
f(|| -> ! ());
} Confirmed with the Dec 20 snapshot (8443b09 2014-12-20 05:52:18 +0000) |
fn f<F, R>(_: F) where F: Fn() -> R {
}
fn main() {
f(|| -> ! { () });
} works fine now. E-needstest. |
This makes the deprecation process of
task::spawn()
non-trivial.Thread::spawn::<(), FnOnce()+Send>(move || panic!("B")).detach();
did not work, either.The text was updated successfully, but these errors were encountered: