File tree 1 file changed +30
-4
lines changed
1 file changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -967,16 +967,18 @@ one.
967
967
"## ,
968
968
969
969
E0423 : 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.
971
972
972
- Erroneous code example:
973
+ For (an erroneous) example, here a `struct` variant name were used as a
974
+ function:
973
975
974
976
```compile_fail,E0423
975
977
struct Foo { a: bool };
976
978
977
979
let 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
980
982
```
981
983
982
984
Please verify you didn't misspell the name of what you actually wanted to use
@@ -987,6 +989,30 @@ fn Foo() -> u32 { 0 }
987
989
988
990
let f = Foo(); // ok!
989
991
```
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
+ ```
990
1016
"## ,
991
1017
992
1018
E0424 : r##"
You can’t perform that action at this time.
0 commit comments