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

rustc: Don't die on 0-length pattern idents #13782

Merged
merged 1 commit into from
May 5, 2014

Conversation

alexcrichton
Copy link
Member

These often crop up when using default methods that don't actually bind their
argument names.

Closes #13775

These often crop up when using default methods that don't actually bind their
argument names.

Closes rust-lang#13775
@sfackler
Copy link
Member

Is this something we want to support? It might make more sense to force the use of _: int for any function declaration with a body.

@alexcrichton
Copy link
Member Author

Not necessarily, but while we do we shouldn't ICE.

There are a number of places where we allow this form of short-hand, but sadly this does lead to ambiguities (#12778)

// except according to those terms.

trait Foo {
fn bar(&self, int) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not really necessary but it would be good to have an implementation of this trait to make sure it works as expected.

@flaper87
Copy link
Contributor

flaper87 commented May 3, 2014

I don't mind having this kind of short-hands. However, it may be weird to be able to use them in trait definitions but not implementations. 👍 for landing this until we figure out what to do about it.

bors added a commit that referenced this pull request May 5, 2014
These often crop up when using default methods that don't actually bind their
argument names.

Closes #13775
@bors bors closed this May 5, 2014
@bors bors merged commit cf9dd70 into rust-lang:master May 5, 2014
@alexcrichton alexcrichton deleted the issue-13775 branch May 6, 2014 03:56
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.

ICE on default method with argument with type but no pattern
5 participants