kinghajj / deque

A (mostly) lock-free concurrent work-stealing deque in Rust.
Other
232 stars 24 forks source link

New Stealer<T> requires T to be Clone now #10

Closed faern closed 8 years ago

faern commented 8 years ago

Hi,

I didn't read the C11 implementation that the last version was based on, so maybe I'm wrong here.

Previously I could clone a Stealer<T> even when T was not implementing Clone. With 0.3.0 I can't do that. Is this intentional or a bug? I need to be able to clone my Stealers for deques where the content can't be cloned.

src/workerthread.rs:73:22: 73:29 error: no method named `clone` found for type `deque::Stealer<Task<Arg, Ret>>` in the current scope
src/workerthread.rs:73         self.stealer.clone()
                                            ^~~~~~~
src/workerthread.rs:73:22: 73:29 note: the method `clone` exists but the following trait bounds were not satisfied: `Task<Arg, Ret> : core::clone::Clone`

I can submit a PR with a fix if it's a bug. If it's intended I would like to know why this has changed. Thanks. Ping @Amanieu

Amanieu commented 8 years ago

It's a bug, it seems #[derive(Clone)] isn't working for some reason. Replacing it with a manual implementation of clone should fix it.

kinghajj commented 8 years ago

Fixed by PR #11.