Closed
Description
struct MyStruct { field: u8 }
fn main() {
MyStruct.foo;
}
results in
<anon>:4:5: 4:13 error: `MyStruct` is the name of a struct or struct variant, but this expression uses it like a function name [E0423]
<anon>:4 MyStruct.foo;
^~~~~~~~
<anon>:4:5: 4:13 help: see the detailed explanation for E0423
<anon>:4:5: 4:13 help: did you mean to write: `MyStruct { /* fields */ }`?
error: aborting due to previous error
in particular
but this expression uses it like a function name
which doesn't make sense in this context. the same error message appears if one attempts MyStruct()
, which makes more sense.