compiler/rustc_error_codes/src/error_codes/E0423.md MARKDOWN 58 lines View on github.com → Search inside
1An identifier was used like a function name or a value was expected and the2identifier exists but it belongs to a different namespace.34Erroneous code example:56```compile_fail,E04237struct Foo { a: bool };89let f = Foo();10// error: expected function, tuple struct or tuple variant, found `Foo`11// `Foo` is a struct name, but this expression uses it like a function name12```1314Please verify you didn't misspell the name of what you actually wanted to use15here. Example:1617```18fn Foo() -> u32 { 0 }1920let f = Foo(); // ok!21```2223It is common to forget the trailing `!` on macro invocations, which would also24yield this error:2526```compile_fail,E042327println("");28// error: expected function, tuple struct or tuple variant,29// found macro `println`30// did you mean `println!(...)`? (notice the trailing `!`)31```3233Another case where this error is emitted is when a value is expected, but34something else is found:3536```compile_fail,E042337pub mod a {38    pub const I: i32 = 1;39}4041fn h1() -> i32 {42    a.I43    //~^ ERROR expected value, found module `a`44    // did you mean `a::I`?45}46```4748### Enum types used as values4950Enums are types and cannot be used directly as values.5152```compile_fail,E042353fn main(){54    let x = Option::<i32>;55    //~^ ERROR expected value,found enum `Option`56}57```

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.