{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/22692","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/22692/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/22692/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/22692/events","html_url":"https://github.com/rust-lang/rust/issues/22692","id":58528298,"number":22692,"title":"Better user experience when attempting to call static methods with dot notation","user":{"login":"frewsxcv","id":416575,"avatar_url":"https://avatars.githubusercontent.com/u/416575?v=3","gravatar_id":"","url":"https://api.github.com/users/frewsxcv","html_url":"https://github.com/frewsxcv","followers_url":"https://api.github.com/users/frewsxcv/followers","following_url":"https://api.github.com/users/frewsxcv/following{/other_user}","gists_url":"https://api.github.com/users/frewsxcv/gists{/gist_id}","starred_url":"https://api.github.com/users/frewsxcv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frewsxcv/subscriptions","organizations_url":"https://api.github.com/users/frewsxcv/orgs","repos_url":"https://api.github.com/users/frewsxcv/repos","events_url":"https://api.github.com/users/frewsxcv/events{/privacy}","received_events_url":"https://api.github.com/users/frewsxcv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-22T23:42:28Z","updated_at":"2015-02-22T23:42:28Z","closed_at":null,"body":"New users might attempt to write something like this, (e.g. if they're coming from Java):\r\n\r\n```rust\r\nfn main() {\r\n    let _ = String.new();\r\n}\r\n```\r\n\r\nThis will not compile since they're not using `::`. This is what the compiler outputs when compiling:\r\n\r\n```\r\n~ $ rustc program.rs\r\nprogram.rs:2:13: 2:19 error: unresolved name `String`\r\nprogram.rs:2     let _ = String.new();\r\n                         ^~~~~~\r\n```\r\n\r\nI 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()`)."}}