-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking Issue for Exclusive
#98407
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
Comments
This is probably a bikeshed, but perhaps the This does make it asymmetric with |
@clarfonthey that would conflict with https://doc.rust-lang.org/std/pin/struct.Pin.html#method.get_mut |
To provide some motivation I have been using a more limited internal version of this for about 3 years in |
@Nemo157 I think we should try to get this in at 1.66, next week ill take a look at writing a stabilization report |
Hi! I've submitted PR #104057, with a few small changes:
I would be happy to write a stabilization PR when this passes an FCP. |
For the same reason that I don't know if it would be that useful (even ignoring that there's been some disucssion about deprecating |
Interestingly, in bevyengine/bevy#7718, they are adding a method called |
The method above is quite useful for us, but is a contradiction with the This is quite a useful type, and it would be a shame to see something limited get locked in via stabilization. (summarized from conversation in the Bevy Discord). |
I agree that |
I don't think |
The main issue with using the What we have is some sort of static mutex, but I'm not sure if using that terminology is helpful either. |
I agree that the I think the name should emphasize the fact that the purpose of this type is to gurantee |
We should just name it |
Is it possible (and how) to make
|
You could also "cheat" by implementing traits that have read-only methods specifically for |
I don't think that would work? If you have a Well, Trying to implement <&mut Exclusive as Iterator>::size_hint normallyimpl<I: ?Sized + Iterator> Iterator for &mut Exclusive<I> {
type Item = I::Item;
fn next(&mut self) -> Option<I::Item> {
self.get_mut().next() // this is fine
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.get_mut().size_hint()
// cannot borrow `**self` as mutable, as it is behind a `&` reference
}
} |
…right, initially I thought that reborrows of the initial |
Is there anything blocking this from stabilization? It looks old enough at this point and I don’t see any open concerns in this thread. It looks like it just waits for an FCP? |
Revoked; See below. Sorry for the notifications.
If I'm not allowed to put a bounty on this, sorry for the notification and also the next one where someone tells me I'm not allowed to put a bounty on this. I prefer paypal but I can probably work with other stuff. If there's sanctions in the way I can probably mail you something worth $10. |
FCPs rely pretty much entirely on the bandwidth of the team approving the change, not the person writing the stabilisation PR. |
As much as I love setting bounties I don't have the margin to do $10 for every merge vote. Just getting someone to start the FCP basically guarantees a merge soon since it's <200 lines of a fairly straightforward feature. I realize even that is worth at least $20 per person but even just $10 is a pretty big chunk of my bounty money. |
I guess my point is that it seems unlikely that, even if someone were to accept the bribe, it would actually perceptibly merge faster. A stabilisation PR and an FCP take no time at all to write for a small change like this and I'm not sure if people would feel comfortable prioritising this feature over others in exchange of money. |
In light of the rapid consensus, I'll be sure to not do that again. Sorry. |
Feature gate:
#![feature(exclusive_wrapper)]
This is a tracking issue for the
Exclusive
wrapper struct.This structure can be used to upgrade non-
Sync
objects intoSync
ones, by only offering mutable access to the underlying object. This can be useful withSend
-but-not-Sync
futures (likeBoxFuture
s)Public API
Steps / History
Exclusive
to sync #97629Unresolved Questions
The text was updated successfully, but these errors were encountered: