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

Support T::Type shorthand for referencing associated types #18433

Closed
nikomatsakis opened this issue Oct 29, 2014 · 1 comment · Fixed by #19789
Closed

Support T::Type shorthand for referencing associated types #18433

nikomatsakis opened this issue Oct 29, 2014 · 1 comment · Fixed by #19789
Assignees
Labels
A-associated-items Area: Associated items (types, constants & functions)

Comments

@nikomatsakis
Copy link
Contributor

Today we support only the very explicit notation of <T as Trait>::Type. It'd be nice to support the shorter notation of T::Type. Eventually this should work in as wide a variety of circumstances as possible, but for the time being it might be ok to introduce a hack to make this work, such as only if T has a single applicable trait bound. But we have to be careful that this hack is forwards compatible (so, e.g., just picking the first trait bound unambiguously is probably not a good idea).

@huonw huonw added the A-associated-items Area: Associated items (types, constants & functions) label Nov 20, 2014
@nrc nrc self-assigned this Dec 3, 2014
nrc added a commit to nrc/rust that referenced this issue Dec 5, 2014
@milibopp
Copy link
Contributor

milibopp commented Dec 5, 2014

In the definition of a trait with associated types, would it even be possible to refer to the associated type by its name only (i.e. without the <Self as Trait>:: prefix altogether)?

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 (types, constants & functions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants