Skip to content

Commit 4db2ad2

Browse files
author
Nick Hamann
committed
---
yaml --- r: 212199 b: refs/heads/tmp c: 037456a h: refs/heads/master i: 212197: 78058ff 212195: de22887 212191: 4cc9514 v: v3
1 parent c2f582c commit 4db2ad2

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
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 62e70d35be3fe532c26a400b499c58a18f18dd3a
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: f1db9cd7c3f9612c4d5d594fd81bf4ca1e721540
35+
refs/heads/tmp: 037456a593d282d039a4df0de3aebdd72157bb74
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: b77d60adb019bb5de05e884a99f3290ec4694137
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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)