Skip to content

Commit 90c6195

Browse files
author
Nick Hamann
committed
---
yaml --- r: 225525 b: refs/heads/stable c: 037456a h: refs/heads/master i: 225523: bf5e4a6 v: v3
1 parent 2a6f4fa commit 90c6195

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: f1db9cd7c3f9612c4d5d594fd81bf4ca1e721540
32+
refs/heads/stable: 037456a593d282d039a4df0de3aebdd72157bb74
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/src/librustc_typeck/collect.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,11 @@ fn convert_methods<'a,'tcx,'i,I>(ccx: &CrateCtxt<'a, 'tcx>,
752752
let mut seen_methods = FnvHashSet();
753753
for (sig, id, ident, vis, span) in methods {
754754
if !seen_methods.insert(ident.name) {
755-
span_err!(tcx.sess, span, E0201, "duplicate associated function");
755+
let fn_desc = match sig.explicit_self.node {
756+
ast::SelfStatic => "associated function",
757+
_ => "method",
758+
};
759+
span_err!(tcx.sess, span, E0201, "duplicate {}", fn_desc);
756760
}
757761

758762
convert_method(ccx,

branches/stable/src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ trait Baz {
901901
impl Baz for Foo {
902902
fn baz(&self) -> bool { true }
903903
904-
// error: duplicate associated function
904+
// error: duplicate method
905905
fn baz(&self) -> bool { self.0 > 5 }
906906
}
907907
```

branches/stable/src/test/compile-fail/impl-duplicate-methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
struct Foo;
1212
impl Foo {
1313
fn orange(&self){}
14-
fn orange(&self){} //~ ERROR duplicate associated function
14+
fn orange(&self){} //~ ERROR duplicate method
1515
}
1616

1717
fn main() {}

branches/stable/src/test/compile-fail/issue-8153.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trait Bar {
1818

1919
impl Bar for Foo {
2020
fn bar(&self) -> isize {1}
21-
fn bar(&self) -> isize {2} //~ ERROR duplicate associated function
21+
fn bar(&self) -> isize {2} //~ ERROR duplicate method
2222
}
2323

2424
fn main() {

branches/stable/src/test/compile-fail/method-macro-backtrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl S {
2929

3030
// Cause an error. It shouldn't have any macro backtrace frames.
3131
fn bar(&self) { }
32-
fn bar(&self) { } //~ ERROR duplicate associated function
32+
fn bar(&self) { } //~ ERROR duplicate method
3333
}
3434

3535
fn main() { }

0 commit comments

Comments
 (0)