- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-grammarArea: The grammar of RustArea: The grammar of Rust
Description
struct S {
    #[cfg(untrue)]
    a: int,
}
fn main() {
    let s = S;
}<anon>:7:13: 7:14 error: `S` is a structure name, but this expression uses it like a function name
<anon>:7     let s = S;
                     ^
<anon>:7:13: 7:14 note: Did you mean to write: `S { /* fields */ }`?
<anon>:7     let s = S;
                     ^
Here S { } is suggested but it is also not allowed:
<anon>:7:14: 7:15 error: structure literal must either have at least one field or use functional structure update syntax
<anon>:7     let s = S{};
                      ^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-grammarArea: The grammar of RustArea: The grammar of Rust