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

s/method/associated function/ in E0201 #25981

Merged
merged 2 commits into from
Jun 4, 2015
Merged

Conversation

nham
Copy link
Contributor

@nham nham commented Jun 3, 2015

It seems better to use "associated function" here. Methods are associated functions that take a self parameter.

@rust-highfive
Copy link
Collaborator

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
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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

@alexcrichton
Copy link
Member

@bors: r+ 037456a

Thanks!

@bors
Copy link
Contributor

bors commented Jun 4, 2015

⌛ Testing commit 037456a with merge e4a064d...

@bors
Copy link
Contributor

bors commented Jun 4, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jun 3, 2015 at 9:18 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/5228


Reply to this email directly or view it on GitHub
#25981 (comment).

@bors
Copy link
Contributor

bors commented Jun 4, 2015

⌛ Testing commit 037456a with merge 1f7a469...

@bors
Copy link
Contributor

bors commented Jun 4, 2015

💔 Test failed - auto-mac-32-opt

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jun 3, 2015 at 9:30 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-32-opt
http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5236


Reply to this email directly or view it on GitHub
#25981 (comment).

@bors
Copy link
Contributor

bors commented Jun 4, 2015

⌛ Testing commit 037456a with merge 4962c41...

@bors
Copy link
Contributor

bors commented Jun 4, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jun 3, 2015 at 9:36 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/5232


Reply to this email directly or view it on GitHub
#25981 (comment).

@bors
Copy link
Contributor

bors commented Jun 4, 2015

⌛ Testing commit 037456a with merge f10fd42...

@bors
Copy link
Contributor

bors commented Jun 4, 2015

💔 Test failed - auto-win-gnu-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jun 3, 2015 at 10:49 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-gnu-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-win-gnu-64-nopt-t/builds/188


Reply to this email directly or view it on GitHub
#25981 (comment).

@bors
Copy link
Contributor

bors commented Jun 4, 2015

⌛ Testing commit 037456a with merge 52e530a...

bors added a commit that referenced this pull request Jun 4, 2015
It seems better to use "associated function" here. Methods are associated functions that take a `self` parameter.
@bors bors merged commit 037456a into rust-lang:master Jun 4, 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.

6 participants