Skip to content

Commit 5429c9b

Browse files
Add E0423 error explanation
1 parent d10ff63 commit 5429c9b

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,29 @@ match 0 {
425425
```
426426
"##,
427427

428+
E0424: r##"
429+
A `struct` variant name was used like a function name. Example of
430+
erroneous code:
431+
432+
```
433+
struct Foo { a: bool};
434+
435+
println!("I am {}", Foo);
436+
// error: `Foo` is a struct variant name, but this expression uses
437+
// it like a function name
438+
```
439+
440+
Please verify you didn't misspell the name of what you actually wanted
441+
to use here. Example:
442+
443+
```
444+
struct Foo { a: bool};
445+
446+
let foo = Foo { a: true };
447+
println!("I am {}", foo); // ok!
448+
```
449+
"##,
450+
428451
E0424: r##"
429452
The `self` keyword was used in a static method. Example of erroneous code:
430453
@@ -660,8 +683,6 @@ register_diagnostics! {
660683
E0420, // is not an associated const
661684
E0421, // unresolved associated const
662685
E0422, // does not name a structure
663-
E0423, // is a struct variant name, but this expression uses it like a
664-
// function name
665686
E0427, // cannot use `ref` binding mode with ...
666687
E0429, // `self` imports are only allowed within a { } list
667688
E0434, // can't capture dynamic environment in a fn item

0 commit comments

Comments
 (0)