-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Assert covariance of BTree{Map,Set}
and associated iterators
#88058
Conversation
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
There’s also the variance of the lifetime parameter that could be asserted for types like fn iter<'a>(x: Iter<'static, &'static (), &'static ()>) -> Iter<'a, &'a (), &'a ()> {
x
} for |
I followed HashMap, which has separate key and value assertions. |
Alright, still the covariance of the lifetime argument of |
If |
In that case I'll just merge the checks into one... otherwise it'll too verbose. As for |
It turns out there are already tests for variances, just that they are named |
Of course these tests don't cover lifetime parameters, so it might worth doing that. |
Difference
etc are not yet covariant, see #30642.