-
Notifications
You must be signed in to change notification settings - Fork 17
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
relax lifetime constraints on AtomicRef #25
Conversation
My best guess is that #24 is caused by rust-lang/rust#110338 and the explicit I used the I think these are the correct bounds, but you can double check them against the previously generated bounds: |
It's interesting that |
Yeah, I was surprised as well... and also that it leads to this inference problem... I could have bet that it's because of the hrtb. but no... those are fine |
I would be surprised if the hrtb aren't involved though, i.e. I would guess that it is this combined with the hrtb |
e.g. I'm guessing this would not cause issues even though it keeps the unnecessary unsafe impl<'b, T: ?Sized + 'b> Send for AtomicRefMut<'b, T> where T: Send {} |
No, I removed them first, because I thought they were the reason... but the error stayed... only removing I also think we can leave the |
Oh! |
That sounds reasonable to me then. |
Thanks! |
fixes and tests the problem described in #24.
I had to set
editon
to 2018, to make the async test work. If this is undesirable, I can move the test to a different crate.I'm reasonable confident, that the changes are correct, because the compiler would generate even less restrictive Sync/Send implementation in a previous version.
On the other hand, I have to admit, that I'm not really understanding why this change fixes #24...
pub struct AtomicRef<'b, T: ?Sized + 'b>
hasT: 'b
after all.Maybe @Imberflur can weigh in?