Skip to content

Commit 2e919b4

Browse files
Add E0433 error explanation
1 parent c13295b commit 2e919b4

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

src/librustc_resolve/diagnostics.rs

+41-13
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ See the 'Use Declarations' section of the reference for more information
272272
on this topic:
273273
274274
http://doc.rust-lang.org/reference.html#use-declarations
275-
"##
275+
"##,
276276

277277
E0403: r##"
278278
Some type parameters have the same name. Example of erroneous code:
@@ -282,7 +282,7 @@ 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 that none of the type params are misspelled, and rename any
285+
Please verify that none of the type parameterss are misspelled, and rename any
286286
clashing parameters. Example:
287287
288288
```
@@ -291,8 +291,8 @@ fn foo<T, Y>(s: T, u: Y) {} // ok!
291291
"##,
292292

293293
E0404: r##"
294-
You tried to implement a non-trait object on an object. Example of erroneous
295-
code:
294+
You tried to implement something which was not a trait on an object. Example of
295+
erroneous code:
296296
297297
```
298298
struct Foo;
@@ -301,8 +301,8 @@ struct Bar;
301301
impl Foo for Bar {} // error: `Foo` is not a trait
302302
```
303303
304-
Please verify you didn't mispelled the trait's name or used the wrong object.
305-
Example:
304+
Please verify that you didn't misspell the trait's name or otherwise use the
305+
wrong identifier. Example:
306306
307307
```
308308
trait Foo {
@@ -317,7 +317,7 @@ impl Foo for Bar { // ok!
317317
"##,
318318

319319
E0405: r##"
320-
A non-trait was implemented. Example of erroneous code:
320+
An unknown trait was implemented. Example of erroneous code:
321321
322322
```
323323
struct Foo;
@@ -346,8 +346,8 @@ impl SomeTrait for Foo { // ok!
346346
"##,
347347

348348
E0407: r##"
349-
A definition of a method not in the implemented trait was given. Example of
350-
erroneous code:
349+
A definition of a method not in the implemented trait was given in a trait
350+
implementation. Example of erroneous code:
351351
352352
```
353353
trait Foo {
@@ -362,8 +362,8 @@ impl Foo for Bar {
362362
}
363363
```
364364
365-
Please verify you didn't mispelled the method name and you used the good
366-
trait. Example:
365+
Please verify you didn't misspell the method name and you used the correct
366+
trait. First example:
367367
368368
```
369369
trait Foo {
@@ -378,6 +378,24 @@ impl Foo for Bar {
378378
fn b() {} // ok!
379379
}
380380
```
381+
382+
Second example:
383+
384+
```
385+
trait Foo {
386+
fn a();
387+
}
388+
389+
struct Bar;
390+
391+
impl Foo for Bar {
392+
fn a() {}
393+
}
394+
395+
impl Bar {
396+
fn b() {}
397+
}
398+
```
381399
"##,
382400

383401
E0428: r##"
@@ -389,7 +407,7 @@ struct Bar;
389407
struct Bar; // error: duplicate definition of value `Bar`
390408
```
391409
392-
Please verify you didn't mispelled the type/module's name or remove the
410+
Please verify you didn't misspell the type/module's name or remove/rename the
393411
duplicated one. Example:
394412
395413
```
@@ -398,6 +416,17 @@ struct Bar2; // ok!
398416
```
399417
"##,
400418

419+
E0433: r##"
420+
Invalid import. Example of erroneous code:
421+
422+
```
423+
use something_which_doesnt_exist;
424+
// error: unresolved import `something_which_doesnt_exist`
425+
```
426+
427+
Please verify you didn't misspell the import's name.
428+
"##,
429+
401430
}
402431

403432
register_diagnostics! {
@@ -438,7 +467,6 @@ register_diagnostics! {
438467
E0431, // `self` import can only appear in an import list with a non-empty
439468
// prefix
440469
E0432, // unresolved import
441-
E0433, // failed to resolve
442470
E0434, // can't capture dynamic environment in a fn item
443471
E0435, // attempt to use a non-constant value in a constant
444472
E0437, // type is not a member of trait

0 commit comments

Comments
 (0)