Skip to content
This repository was archived by the owner on Nov 5, 2018. It is now read-only.

spawn_unchecked and builder_spawn_unchecked should return ScopedJoinHandle<T> #25

Closed
ghost opened this issue Jul 23, 2018 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Jul 23, 2018

Currently they return a ScopedJoinHandle<()>.

@jeehoonkang
Copy link
Collaborator

Are you meaning that spawn_unchecked returns JoinHandle<()> rather than JoinHandle<T>, right?

It seems it's hard to do so right now. First of all, JoinHandle<T> requires T: 'static, while spawn_unchecked doesn't require T. So the best we can get may be JoinHandle<[u8; mem::size_of::<T>()]>, but it's impossible to do so right now, too: rust-lang/rust#43408

@ghost
Copy link
Author

ghost commented Jul 26, 2018

Yeah, so ideally we'd want to relax the bounds on the returned type T by requiring T: 'a but right now we have to settle with T: 'static.

@ghost ghost closed this as completed in #30 Jul 26, 2018
ghost pushed a commit that referenced this issue Jul 26, 2018
Closes #25 

Note that we're still keeping `T: 'static`.
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant