-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
identify traits in libstd that should use associated types (as output parameters) #17826
Comments
Nominating. This is a backward compatibility hazard for our llibraries, so P-backcompat-libs. Furthermore, the libraries in question are pretty fundamental, so I think it may also belong on the 1.0 milestone. |
Assigning P-backcompat-libs, 1.0. |
There are a few traits like |
A very good example: the state parameter of the hasher trait. I'd like to identify other cases like this which violate the proposed rules in rust-lang/rfcs#447, as those are higher priority to convert |
This is basically done. Remaining cases can be addressed during stabilization. |
as a subtask of #17307, once associated types are implemented, we will want to update libstd to use them, rather than continuing to use type parameters to traits as a way to encode so-called "output types" associated with an impl.
I ran the following ack invocation:
ack --rust 'pub.*trait.*<'
and then manually surveyed the results to determine the set of traits we might need to update. (I haven't finished the survey yet.)Here is a google doc with partial results. There are at most 65 cases that I identified via this method, mostly in
collections
,core::iter
,core::ops
, andcore::slice
.https://docs.google.com/spreadsheets/d/1Y_NAgzEK3FWcG0LjcykyKJEAibSFI3w-v-ekZ4GU8n4/edit?usp=sharing
The text was updated successfully, but these errors were encountered: