File tree Expand file tree Collapse file tree 1 file changed +30
-4
lines changed
Expand file tree Collapse file tree 1 file changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -967,16 +967,18 @@ one.
967967"## ,
968968
969969E0423 : r##"
970- A `struct` variant name was used like a function name.
970+ An identifier was used like a function name or a value was expected and the
971+ identifier exists but it belongs to a different namespace.
971972
972- Erroneous code example:
973+ For (an erroneous) example, here a `struct` variant name were used as a
974+ function:
973975
974976```compile_fail,E0423
975977struct Foo { a: bool };
976978
977979let f = Foo();
978- // error: `Foo` is a struct variant name, but this expression uses
979- // it like a function name
980+ // error: expected function, found `Foo`
981+ // `Foo` is a struct name, but this expression uses it like a function name
980982```
981983
982984Please verify you didn't misspell the name of what you actually wanted to use
@@ -987,6 +989,30 @@ fn Foo() -> u32 { 0 }
987989
988990let f = Foo(); // ok!
989991```
992+
993+ It is common to forget the trailing `!` on macro invocations, which would also
994+ yield this error:
995+
996+ ```compile_fail,E0423
997+ println("");
998+ // error: expected function, found macro `println`
999+ // did you mean `println!(...)`? (notice the trailing `!`)
1000+ ```
1001+
1002+ Another case where this error is emitted is when a value is expected, but
1003+ something else is found:
1004+
1005+ ```compile_fail,E0423
1006+ pub mod a {
1007+ pub const I: i32 = 1;
1008+ }
1009+
1010+ fn h1() -> i32 {
1011+ a.I
1012+ //~^ ERROR expected value, found module `a`
1013+ // did you mean `a::I`?
1014+ }
1015+ ```
9901016"## ,
9911017
9921018E0424 : r##"
You can’t perform that action at this time.
0 commit comments