-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`
Description
The following code
struct MyClass{
pub field:i32,
}
fn main(){
let myClass = MyClass{field=5};
}
produces the following error message:
error: expected one of `,` or `}`, found `=`
This code errors because "field=5" should be "field:5". The error message leads any good python programmer astray. I think the error message should at least mention the possibility of :
.
This probably belongs in A-diagnostics
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`