Skip to content

Commit c9ba8d1

Browse files
---
yaml --- r: 221163 b: refs/heads/tmp c: 9581154 h: refs/heads/master i: 221161: f767a3a 221159: 853908b v: v3
1 parent f84cbc9 commit c9ba8d1

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: c8bab9d06a179028a0d5129aa62f09d694d9cc49
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: bc79f20ccac4ead82fae1464ea0916e78e04616f
28+
refs/heads/tmp: 95811546e6dabc1946a155c70a4635b9d76dcb8d
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e58601ab085591c71a27ae82137fc313222c2270
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/librustc_resolve/diagnostics.rs

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,7 @@ impl Foo for Bar { // ok!
317317
"##,
318318

319319
E0405: r##"
320-
You tried to implement an undefined trait on an object. Example of
321-
erroneous code:
320+
A non-trait was implemented. Example of erroneous code:
322321
323322
```
324323
struct Foo;
@@ -344,7 +343,42 @@ impl SomeTrait for Foo { // ok!
344343
// implements functions
345344
}
346345
```
347-
"##
346+
"##,
347+
348+
E0407: r##"
349+
A definition of a method not in the implemented trait was given. Example of
350+
erroneous code:
351+
352+
```
353+
trait Foo {
354+
fn a();
355+
}
356+
357+
struct Bar;
358+
359+
impl Foo for Bar {
360+
fn a() {}
361+
fn b() {} // error: method `b` is not a member of trait `Foo`
362+
}
363+
```
364+
365+
Please verify you didn't mispelled the method name and you used the good
366+
trait. Example:
367+
368+
```
369+
trait Foo {
370+
fn a();
371+
fn b();
372+
}
373+
374+
struct Bar;
375+
376+
impl Foo for Bar {
377+
fn a() {}
378+
fn b() {} // ok!
379+
}
380+
```
381+
"##,
348382

349383
}
350384

@@ -357,7 +391,6 @@ register_diagnostics! {
357391
E0401, // can't use type parameters from outer function
358392
E0402, // cannot use an outer type parameter in this context
359393
E0406, // undeclared associated type
360-
E0407, // method is not a member of trait
361394
E0408, // variable from pattern #1 is not bound in pattern #
362395
E0409, // variable is bound with different mode in pattern # than in
363396
// pattern #1

0 commit comments

Comments
 (0)