-
Notifications
You must be signed in to change notification settings - Fork 207
Implement Vec::drain
, as_(mut_)view
on the *Inner
types, generic over Storage
#500
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
Vec::drain
, as_(mut_)view
the *Inner
types, generic over Storage
Vec::drain
, as_(mut_)view
on the *Inner
types, generic over Storage
I checked with nightly, we can't do that with just a |
2f7f596
to
f40513e
Compare
f40513e
to
1ce08b4
Compare
1ce08b4
to
896bf6b
Compare
dd08393
to
e4de53b
Compare
c411836
to
eb0fc28
Compare
To get it working with |
eb0fc28
to
729db74
Compare
729db74
to
85e947f
Compare
The cpass tests are blocked by a compiler bug that has been fixed today. I'm not sure if the fix will be included in 1.86 or whether we will have to wait for 1.87: rust-lang/rust#138979 |
Ok, I have a workaround for the compiler ICE, that doesn't appear to have any downsides. Added it and documented it. |
50398e7
to
b01fcfb
Compare
Thanks, @sosthene-nitrokey! |
This makes
drain
usable in the context of an implementation generic over the storageThis also makes it possible to get a
*View
in this same contextThis could also be a way to "de-monomorphize" all the implementations of the
Inner
structs:We could make all implementation define an inner function that is over a
View
type, and start theimplementation with
this = self.as_(mut_)view
, maybe for binary size and compilation time benefits. For example the implementation ofVecInner::push
could be: