Skip to content

Commit 25bbc9f

Browse files
author
Nick Hamann
committed
---
yaml --- r: 211901 b: refs/heads/auto c: 037456a h: refs/heads/master i: 211899: 928e56d v: v3
1 parent f3f1106 commit 25bbc9f

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: f1db9cd7c3f9612c4d5d594fd81bf4ca1e721540
13+
refs/heads/auto: 037456a593d282d039a4df0de3aebdd72157bb74
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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