-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
s/method/associated function/ in E0201 #25981
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -11,7 +11,7 @@ | |||
struct Foo; | |||
impl Foo { | |||
fn orange(&self){} | |||
fn orange(&self){} //~ ERROR error: duplicate method | |||
fn orange(&self){} //~ ERROR duplicate associated function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a method? (something that takes a self
parameter)
I would expect this to say "duplicate method" here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, so maybe what this message should really do is say "duplicate method" when we're dealing with methods, and "duplicate associated function" otherwise. I will see if I can make that work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically, methods are also associated functions, but we have been
calling associated functions that take self methods
On Wed, Jun 3, 2015 at 7:19 AM, Nick Hamann notifications@github.com
wrote:
In src/test/compile-fail/impl-duplicate-methods.rs
#25981 (comment):@@ -11,7 +11,7 @@
struct Foo;
impl Foo {
fn orange(&self){}
- fn orange(&self){} //~ ERROR error: duplicate method
- fn orange(&self){} //~ ERROR duplicate associated function
Ahh, so maybe what this message should really do is say "duplicate method"
when we're dealing with methods, and "duplicate associated function"
otherwise. I will see if I can make that work.—
Reply to this email directly or view it on GitHub
https://github.com/rust-lang/rust/pull/25981/files#r31594420.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton I've changed it so that this example gives "duplicate method" now
⌛ Testing commit 037456a with merge e4a064d... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry On Wed, Jun 3, 2015 at 9:18 PM, bors notifications@github.com wrote:
|
⌛ Testing commit 037456a with merge 1f7a469... |
💔 Test failed - auto-mac-32-opt |
@bors: retry On Wed, Jun 3, 2015 at 9:30 PM, bors notifications@github.com wrote:
|
⌛ Testing commit 037456a with merge 4962c41... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry On Wed, Jun 3, 2015 at 9:36 PM, bors notifications@github.com wrote:
|
⌛ Testing commit 037456a with merge f10fd42... |
💔 Test failed - auto-win-gnu-64-nopt-t |
@bors: retry On Wed, Jun 3, 2015 at 10:49 PM, bors notifications@github.com wrote:
|
It seems better to use "associated function" here. Methods are associated functions that take a `self` parameter.
It seems better to use "associated function" here. Methods are associated functions that take a
self
parameter.