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

Implement associated items #17307

Closed
23 of 26 tasks
alexcrichton opened this issue Sep 16, 2014 · 31 comments
Closed
23 of 26 tasks

Implement associated items #17307

alexcrichton opened this issue Sep 16, 2014 · 31 comments
Labels
A-associated-items Area: Associated items such as associated types and consts. B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. metabug Issues about issues themselves ("bugs about bugs") T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

Tracking issue for rust-lang/rfcs#195

This meta-bug contains links to the most significant tasks remaining for associated items. For a comprehensive listing of bugs, please search using the A-associated-items label.

Post 1.0 Tasks

Completed Tasks

Declined tasks

@alexcrichton alexcrichton added I-nominated B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. labels Sep 16, 2014
@pnkfelix
Copy link
Member

there is debate about whether this contains P-backcompat-lang issues for 1.0, or if the 1.0 issues are solely P-backcompat-libs.

Leaving as I-nominated so that people can take a week teasing apart the sub-issues that stem from the RFC.

@pnkfelix pnkfelix self-assigned this Sep 25, 2014
@pnkfelix
Copy link
Member

leaving I-nominated for anohter week again! assigning to myself to spawn off subissues.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 2, 2014

punting for another week...

@aturon
Copy link
Member

aturon commented Oct 2, 2014

@pnkfelix Want to coordinate this work this week? I want to do an evaluation of how much of associated items has landed in terms of what we need for the libraries, and that could help inform the division into subissues/nominations. Let me know.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 6, 2014

@aturon sure, happy to coordinate. I'm going to actually look at it now; I will either open subissues directly, or, if I do not feel comfortable doing so, then I'll email you with my findings.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 6, 2014

Okay I think I've opened all the subbugs I can think of, and my spreadsheet (google doc) at least represents a hackish sketch of what might need to do be done (though I did not look at libserialize, std::ascii, nor std::io yet.

Anyway, if this sits idle until the next triage meeting, my official recommendation is that we nominate one or more of the tickets that I opened that point to this ticket, and then we remove the nomination from this ticket (since it is a metabug, quite literally now).

@pnkfelix pnkfelix added the metabug Issues about issues themselves ("bugs about bugs") label Oct 6, 2014
@aturon
Copy link
Member

aturon commented Oct 6, 2014

@pnkfelix Thanks for doing this!

One further issue: right now, associated types are (largely) working, and multidispatch is on the way. But associated constants, lifetimes and inherent items are not implemented.

We may want to break those into further issues, so we can triage each part separately. For example, I don't think associated constants need to be 1.0 (we can work around it reasonably in the libraries), but associated lifetimes probably are (because we intend not to allow lifetimes as "input" parameters on a trait, but you need some way to talk about them.)

@pnkfelix
Copy link
Member

pnkfelix commented Oct 6, 2014

@aturon wait, I thought "breaking those into further issues" is exactly what I did by filing #17825 #17826 #17827 #17828 ... I feel like I must be misunderstanding you.

@aturon
Copy link
Member

aturon commented Oct 6, 2014

@pnkfelix The new issues appear to focus on rolling out the features for the libraries, but don't mention actually implementing them :-) but probably they can be triaged together?

@pnkfelix
Copy link
Member

pnkfelix commented Oct 6, 2014

@aturon oh yes I see; you are right, we still need issues for the language changes themselves. But the triage can focus on the library back-compat and stabilization issues, right? That was driving my focus

@aturon
Copy link
Member

aturon commented Oct 6, 2014

@pnkfelix Yep, sounds fine -- and honestly, those issues can probably cover both the implementation and the library work, since the two go hand-in-hand.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 9, 2014

removing i-nominated tag. yay

bors added a commit that referenced this issue Oct 10, 2014
Implement multidispatch and conditional dispatch. Because we do not attempt to preserve crate concatenation, this is a backwards compatible change. This is not yet fully integrated into method dispatch, so "UFCS"-style wrappers must be used to take advantage of the new features (see the run-pass tests).

cc #17307 (multidispatch)
cc #5527 (trait reform -- conditional dispatch)

Because we no longer preserve crate concatenability, this deviates slightly from what was specified in the RFC. The motivation for this change is described in [this blog post](http://smallcultfollowing.com/babysteps/blog/2014/09/30/multi-and-conditional-dispatch-in-traits/). I will post an amendment to the RFC in due course but do not anticipate great controversy on this point -- particularly as the RFCs more important features (e.g., conditional dispatch) just don't work without the change.
@nikomatsakis
Copy link
Contributor

I have been working on this a little. I am going to repurpose this issue to mean specifically bounds that are not builtin types, since builtin type bounds are covered by #17921

@carllerche
Copy link
Member

I am currently hitting issues #17388 and #18757, #17732.

@emberian
Copy link
Member

emberian commented Nov 8, 2014

I'm hitting #17388, #18764, and #17732 as well.

@mitsuhiko
Copy link
Contributor

I'm hitting #18819 which looks a bit like #17732 but different.

@nrc
Copy link
Member

nrc commented Nov 19, 2014

Should there be a work item for defaults for associated types? (I think this is in the RFC)

@aturon
Copy link
Member

aturon commented Nov 20, 2014

@nick29581 I added it to the list, but didn't create an issue yet.

@huonw huonw added the A-associated-items Area: Associated items such as associated types and consts. label Nov 20, 2014
@quantheory
Copy link
Contributor

#19129 (ICE implementing trait with generic parameter and associated type) should be on this list. Unfortunately it prevents the fix for #17388 from really helping much; even though some of the previously affected traits now compile, you can't actually implement any functions associated with those traits.

@aturon
Copy link
Member

aturon commented Nov 23, 2014

@quantheory Added, thanks!

@ftxqxd
Copy link
Contributor

ftxqxd commented Dec 1, 2014

Adding lifetime as a keyword is a backwards-incompatible language change. Is there an issue for this somewhere, and if so, can it be added to this list?

@nikomatsakis
Copy link
Contributor

Meta-note: the top-level comment includes all bugs listed so far that have not yet been fixed.

@rrichardson
Copy link

Found a possible bug wrt to traits which have types which are Deref: #20502

@carllerche
Copy link
Member

My current associated type blockers:

Constraints on nested associated types: #20543
Default type parameters w/ associated types: #20540 (more of a severe API ergonomic issue)

@edwardw
Copy link
Contributor

edwardw commented Feb 15, 2015

cc me

@bluss
Copy link
Member

bluss commented Jun 17, 2015

I updated the list in this issue. A lot of items are done now!

@alexcrichton alexcrichton added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Aug 11, 2015
@retep998
Copy link
Member

Has #8995 been lost from this list somehow?

@bltavares
Copy link
Contributor

Triaging: #20765 and #17825 are closed.

@alexcrichton
Copy link
Member Author

This has basically all long since been implemented, so closing.

@dashed
Copy link

dashed commented Sep 1, 2016

This isn't implemented yet: #8995

malbarbo added a commit to malbarbo/fera that referenced this issue Nov 10, 2017
I tried to write a Subgraph struct that implements the graph traits
(backed by any graph implementation) but got stuck because of
lifetimes. This changes allowed me to make some progress. May be
it can be simplified with associated lifetimes. See
rust-lang/rust#17307.
@Centril
Copy link
Contributor

Centril commented Feb 12, 2018

What happened to associated const bounds as in the following? An omission perhaps?

trait Foo {
    const Bar: usize;
}

fn baz<T: Foo<Bar = 1>>() {}

cc @SergioBenitez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts. B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. metabug Issues about issues themselves ("bugs about bugs") T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests