Skip to content

Commit f767a3a

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

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
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: 0eb7303c7062792049c0ec4ff2c42565db6d60ff
28+
refs/heads/tmp: cd385cbe34d8a9bad2a6d03c1ef50dd04642a379
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: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,41 @@ fn foo<T, T>(s: T, u: T) {} // error: the name `T` is already used for a type
282282
// parameter in this type parameter list
283283
```
284284
285-
Please verify you didn't mispell the type parameters. Example:
285+
Please verify that none of the type params are misspelled, and rename any
286+
clashing parameters. Example:
286287
287288
```
288-
fn foo<T, Y>(s: T, u: Y) {}
289+
fn foo<T, Y>(s: T, u: Y) {} // ok!
290+
```
291+
"##,
292+
293+
E0405: r##"
294+
You tried to implement an undefined trait on an object. Example of
295+
erroneous code:
296+
297+
```
298+
struct Foo;
299+
300+
impl SomeTrait for Foo {} // error: use of undeclared trait name `SomeTrait`
301+
```
302+
303+
Please verify that the name of the trait wasn't misspelled and ensure that it
304+
was imported. Example:
305+
306+
```
307+
// solution 1:
308+
use some_file::SomeTrait;
309+
310+
// solution 2:
311+
trait SomeTrait {
312+
// some functions
313+
}
314+
315+
struct Foo;
316+
317+
impl SomeTrait for Foo { // ok!
318+
// implements functions
319+
}
289320
```
290321
"##
291322

@@ -300,7 +331,6 @@ register_diagnostics! {
300331
E0401, // can't use type parameters from outer function
301332
E0402, // cannot use an outer type parameter in this context
302333
E0404, // is not a trait
303-
E0405, // use of undeclared trait name
304334
E0406, // undeclared associated type
305335
E0407, // method is not a member of trait
306336
E0408, // variable from pattern #1 is not bound in pattern #

0 commit comments

Comments
 (0)