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

Fix use of explicit UFCS syntax to call methods on associated types. #25171

Merged
merged 1 commit into from
May 12, 2015

Conversation

quantheory
Copy link
Contributor

It is currently broken to use syntax such as <T as Foo>::U::static_method() where <T as Foo>::U is an associated type. I was able to fix this and simplify the parser a bit at the same time.

This also fixes the corresponding issue with associated types (#22139), but that's somewhat irrelevant because #22519 is still open, so this syntax still causes an error in type checking.

Similarly, although this fix applies to associated consts, #25046 forbids associated constants from using type parameters or Self, while #19559 means that associated types have to always have one of those two. Therefore, I think that you can't use an associated const from an associated type anyway.

@rust-highfive
Copy link
Collaborator

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@quantheory
Copy link
Contributor Author

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned nrc May 11, 2015
@quantheory
Copy link
Contributor Author

It's maybe more relevant to you @nikomatsakis, and now you're back. I also put you on #25091.

@nikomatsakis
Copy link
Contributor

@quantheory cool, thanks.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2015

📌 Commit efb3872 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented May 12, 2015

⌛ Testing commit efb3872 with merge 0ad2026...

bors added a commit that referenced this pull request May 12, 2015
…atsakis

It is currently broken to use syntax such as `<T as Foo>::U::static_method()` where `<T as Foo>::U` is an associated type. I was able to fix this and simplify the parser a bit at the same time.

This also fixes the corresponding issue with associated types (#22139), but that's somewhat irrelevant because #22519 is still open, so this syntax still causes an error in type checking.

Similarly, although this fix applies to associated consts, #25046 forbids associated constants from using type parameters or `Self`, while #19559 means that associated types have to always have one of those two. Therefore, I think that you can't use an associated const from an associated type anyway.
@bors bors merged commit efb3872 into rust-lang:master May 12, 2015
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 this pull request may close these issues.

5 participants