Skip to content

Commit 9e1ea5e

Browse files
Add E0432 error explanation
1 parent 2537abf commit 9e1ea5e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,11 @@ use something::{self, self}; // error: `self` import can only appear once in
484484
```
485485
486486
Please verify you didn't misspell the import name or remove the duplicated
487-
`self` import.
487+
`self` import. Example:
488+
489+
```
490+
use something::self; // ok!
491+
```
488492
"##,
489493

490494
E0431: r##"
@@ -499,6 +503,25 @@ You can't import the current module in itself, please remove this import or
499503
verify you didn't misspell it.
500504
"##,
501505

506+
E0432: r##"
507+
An import was unresolved. Erroneous code example:
508+
509+
```
510+
use something::Foo; // error: unresolved import `something::Foo`.
511+
```
512+
513+
Please verify you didn't misspell the import name or the import does exist
514+
in the module from where you tried to import it. Example:
515+
516+
```
517+
use something::Foo; // ok!
518+
519+
mod something {
520+
pub struct Foo;
521+
}
522+
```
523+
"##,
524+
502525
E0433: r##"
503526
Invalid import. Example of erroneous code:
504527
@@ -543,7 +566,6 @@ register_diagnostics! {
543566
E0426, // use of undeclared label
544567
E0427, // cannot use `ref` binding mode with ...
545568
E0429, // `self` imports are only allowed within a { } list
546-
E0432, // unresolved import
547569
E0434, // can't capture dynamic environment in a fn item
548570
E0435, // attempt to use a non-constant value in a constant
549571
E0437, // type is not a member of trait

0 commit comments

Comments
 (0)