Skip to content
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

Calling ".join().unwrap()" on a JoinHandle does not work #22707

Closed
RalfJung opened this issue Feb 23, 2015 · 1 comment
Closed

Calling ".join().unwrap()" on a JoinHandle does not work #22707

RalfJung opened this issue Feb 23, 2015 · 1 comment

Comments

@RalfJung
Copy link
Member

I would expect the following code to compile:

use std::thread;
pub fn spawn_and_wait_nothing() {
    std::thread::spawn(||{ let i = 3*4; }).join().unwrap();
}

However, compilation fails, complaining about unwrap not being found. As .ok().unwrap() works, the problem is probably that no implementation for Debug could be found. (#19950 tracks the unhelpful error message.)

@alexcrichton
Copy link
Member

Dupe of #21291, but thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants