Closed
Description
New users might attempt to write something like this, (e.g. if they're coming from Java):
fn main() {
let _ = String.new();
}
This will not compile since they're not using ::
. This is what the compiler outputs when compiling:
~ $ rustc program.rs
program.rs:2:13: 2:19 error: unresolved name `String`
program.rs:2 let _ = String.new();
^~~~~~
I find this error message pretty misleading. It'd be great if there was a lint that would check the available static methods of a struct/enum and if there's one that matches, suggest it instead (in the case above, suggest using String::new()
).