Skip to content
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

Closed
pnkfelix opened this issue Oct 6, 2014 · 5 comments · Fixed by #20757
Closed

identify traits in libstd that should use associated types (as output parameters) #17826

pnkfelix opened this issue Oct 6, 2014 · 5 comments · Fixed by #20757
Assignees
Milestone

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Oct 6, 2014

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, and core::slice.

https://docs.google.com/spreadsheets/d/1Y_NAgzEK3FWcG0LjcykyKJEAibSFI3w-v-ekZ4GU8n4/edit?usp=sharing

@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 7, 2014

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.

@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 9, 2014

Assigning P-backcompat-libs, 1.0.

@pnkfelix pnkfelix added this to the 1.0 milestone Oct 9, 2014
@japaric
Copy link
Member

japaric commented Nov 4, 2014

There are a few traits like AdditiveIterator that can be "upgraded" to associated types right now, but I can't send a PR until rustdoc learns to deal with associated types (#18594)

@nikomatsakis
Copy link
Contributor

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

@nikomatsakis
Copy link
Contributor

This is basically done. Remaining cases can be addressed during stabilization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants