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
alexcrichton opened this Issue Sep 16, 2014 · 31 comments

Comments

Projects
None yet
@alexcrichton
Copy link
Member

alexcrichton commented Sep 16, 2014

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

  • Normalize associated types used in where clauses (#20765) and associated type bounds (#20775)
  • Implement associated lifetimes (see Issue #17842),
  • Update library code for associated constants (see Issue #17825).

Completed Tasks

  • Implement associated output types (see PR #16377),
  • Update library code for associated output types (see Issue #17826),
  • Implement multi-dispatch (see PR #17669),
  • Update library code for multi-dispatch (see Issue #17827),
  • ICE: Unbound path #17388
  • Clarify outlives requirements on projected types (#20303)
  • Integrate projection types into method dispatch #20469
  • Some types not normalized? #20604
  • ICE with missing impl items #20347
  • Associated types should permit builtin bounds (#17921)
  • Implement Trait<Out=Type> syntax (#18432)
  • Support T::Type syntax (#18433)
  • Associated types are used as inputs for multidispatch (#18437)
  • Traits with associated types appearing on structs, enums, or other traits (#18768)
  • Qualified paths don't check type arguments in the trait reference (#18865)
  • rustdoc panics when dealing with associated types (#18594)
  • Associated types should permit arbitrary bounds (#18178)
  • Associated types need to do transitive bound expansion (#18434)
  • Traits with where clauses that themselves reference traits with assoc types (#18436)
  • Integrate object projection predicates into rustdoc (#20299)
  • Convert T::Foo resolution to use where clauses, not bounds (#20300)
  • Implement associated constants (see Issue #17841),
  • Implement defaults for associated types (see issue #19476),

Declined tasks

  • Permit unqualified references to associated types of the trait within the trait definition (#18764)
  • Update library code for associated lifetimes (see Issue #17828),
@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Sep 18, 2014

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

This comment has been minimized.

Copy link
Member

pnkfelix commented Sep 25, 2014

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

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Oct 2, 2014

punting for another week...

@aturon

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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 label Oct 6, 2014

@aturon

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

pnkfelix commented Oct 9, 2014

removing i-nominated tag. yay

@pnkfelix pnkfelix removed the I-nominated label Oct 9, 2014

bors added a commit that referenced this issue Oct 10, 2014

auto merge of #17669 : nikomatsakis/rust/multidispatch, r=pcwalton
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

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Oct 29, 2014

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

This comment has been minimized.

Copy link
Member

carllerche commented Nov 8, 2014

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

@cmr

This comment has been minimized.

Copy link
Member

cmr commented Nov 8, 2014

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

@mitsuhiko

This comment has been minimized.

Copy link
Contributor

mitsuhiko commented Nov 9, 2014

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

@nrc

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

aturon commented Nov 20, 2014

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

@quantheory

This comment has been minimized.

Copy link
Contributor

quantheory commented Nov 22, 2014

#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

This comment has been minimized.

Copy link
Member

aturon commented Nov 23, 2014

@quantheory Added, thanks!

@P1start

This comment has been minimized.

Copy link
Contributor

P1start 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

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 3, 2015

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

@rrichardson

This comment has been minimized.

Copy link

rrichardson commented Jan 4, 2015

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

@carllerche

This comment has been minimized.

Copy link
Member

carllerche commented Jan 4, 2015

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

This comment has been minimized.

Copy link
Contributor

edwardw commented Feb 15, 2015

cc me

@bluss

This comment has been minimized.

Copy link
Contributor

bluss commented Jun 17, 2015

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

@retep998

This comment has been minimized.

Copy link
Member

retep998 commented Dec 16, 2015

Has #8995 been lost from this list somehow?

@bltavares

This comment has been minimized.

Copy link
Contributor

bltavares commented Jan 17, 2016

Triaging: #20765 and #17825 are closed.

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Feb 18, 2016

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

@dashed

This comment has been minimized.

Copy link

dashed commented Sep 1, 2016

This isn't implemented yet: #8995

@SoniEx2 SoniEx2 referenced this issue Jun 11, 2017

Open

Heads. #322

malbarbo added a commit to malbarbo/fera that referenced this issue Nov 10, 2017

Add lifetime parameter to all graph traits.
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

This comment has been minimized.

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
You can’t perform that action at this time.