-
Notifications
You must be signed in to change notification settings - Fork 13
Add bounds for WorkerLocal's Send and Sync #8
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
Conversation
Could you add comments to the code justifying why these bounds are correct? |
Good point, added a comment justifying the |
Let's just leave it to auto-impl then, as you proposed earlier. |
Done. |
Hmm, combing over this again -- |
Good catch, I completely looked over the |
Note that this causes compile failures in rustc_middle currently:
|
@jyn514 Yikes! That looks like a real problem that will need to be fixed in |
I'm just the messenger, sorry, I don't know how to fix it. I found this PR originally because I was trying to fix rust-lang/rust#82636 before realizing it needed |
It looks like it was added by @Zoxc in rust-lang/rust@43e33ea with very few changes since then. |
It's difficult since it uses type erasure, and it can't always require |
OK, I think I have the Thanks for the fix, @ammaraskar! |
This pulls in rust-lang/rustc-rayon#8 to fix rust-lang#81425. (h/t @ammaraskar) That revealed weak constraints on `rustc_arena::DropArena`, because its `DropType` was holding type-erased raw pointers to generic `T`. We can implement `Send` for `DropType` (under `cfg(parallel_compiler)`) by requiring all `T: Send` before they're type-erased.
…ulacrum Update to rustc-rayon 0.3.1 This pulls in rust-lang/rustc-rayon#8 to fix rust-lang#81425. (h/t `@ammaraskar)` That revealed weak constraints on `rustc_arena::DropArena`, because its `DropType` was holding type-erased raw pointers to generic `T`. We can implement `Send` for `DropType` (under `cfg(parallel_compiler)`) by requiring all `T: Send` before they're type-erased.
See rust-lang/rust#81425
We could let the auto impl take care of
Send
if that would be preferable.