{"action":"created","comment":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments/50179957","id":50179957,"diff_hunk":"@@ -209,4 +209,20 @@ fn main() {\n     let mut index = 0;\n     for _v in &vec { index += 1 }\n     println!(\"index: {}\", index);\n+\n+    let m : HashMap<u64, u64> = HashMap::new();\n+    for (_, v) in &m {\n+        //~^ you seem to want to iterate on a map's values\n+        //~| HELP use the corresponding method\n+        //~| SUGGESTION for v in &m.values()\n+        let _v = v;\n+    }\n+\n+    let rm = &m;\n+    for (k, _) in rm {\n+        //~^ you seem to want to iterate on a map's keys\n+        //~| HELP use the corresponding method\n+        //~| SUGGESTION for k in rm.keys()\n+        let _k = k;\n+    }\n }","path":"tests/compile-fail/for_loop.rs","position":20,"original_position":20,"commit_id":"3b954b6cf046c6e6d411f5a2e383276db94d8abf","original_commit_id":"3b954b6cf046c6e6d411f5a2e383276db94d8abf","user":{"login":"llogiq","id":4200835,"avatar_url":"https://avatars.githubusercontent.com/u/4200835?v=3","gravatar_id":"","url":"https://api.github.com/users/llogiq","html_url":"https://github.com/llogiq","followers_url":"https://api.github.com/users/llogiq/followers","following_url":"https://api.github.com/users/llogiq/following{/other_user}","gists_url":"https://api.github.com/users/llogiq/gists{/gist_id}","starred_url":"https://api.github.com/users/llogiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llogiq/subscriptions","organizations_url":"https://api.github.com/users/llogiq/orgs","repos_url":"https://api.github.com/users/llogiq/repos","events_url":"https://api.github.com/users/llogiq/events{/privacy}","received_events_url":"https://api.github.com/users/llogiq/received_events","type":"User","site_admin":false},"body":"I'd like to see a test case using a named wild card that is used anyway, e.g. `for (_k, v) in &map { let _x = _k; .. }`.","created_at":"2016-01-19T21:41:34Z","updated_at":"2016-01-19T21:41:34Z","html_url":"https://github.com/Manishearth/rust-clippy/pull/564#discussion_r50179957","pull_request_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564","_links":{"self":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments/50179957"},"html":{"href":"https://github.com/Manishearth/rust-clippy/pull/564#discussion_r50179957"},"pull_request":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564"}}},"pull_request":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564","id":56523353,"html_url":"https://github.com/Manishearth/rust-clippy/pull/564","diff_url":"https://github.com/Manishearth/rust-clippy/pull/564.diff","patch_url":"https://github.com/Manishearth/rust-clippy/pull/564.patch","issue_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/564","number":564,"state":"open","locked":false,"title":"Lint looping on maps ignoring the keys or values","user":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"body":"Fix #13.","created_at":"2016-01-19T20:49:20Z","updated_at":"2016-01-19T21:41:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc537c2bd9c860aff289c1a23ad12b08f82afa7b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564/commits","review_comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564/comments","review_comment_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/564/comments","statuses_url":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/3b954b6cf046c6e6d411f5a2e383276db94d8abf","head":{"label":"mcarton:hashmap","ref":"hashmap","sha":"3b954b6cf046c6e6d411f5a2e383276db94d8abf","user":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"repo":{"id":48387599,"name":"rust-clippy","full_name":"mcarton/rust-clippy","owner":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mcarton/rust-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":true,"url":"https://api.github.com/repos/mcarton/rust-clippy","forks_url":"https://api.github.com/repos/mcarton/rust-clippy/forks","keys_url":"https://api.github.com/repos/mcarton/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mcarton/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mcarton/rust-clippy/teams","hooks_url":"https://api.github.com/repos/mcarton/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/mcarton/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/mcarton/rust-clippy/events","assignees_url":"https://api.github.com/repos/mcarton/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/mcarton/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/mcarton/rust-clippy/tags","blobs_url":"https://api.github.com/repos/mcarton/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mcarton/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mcarton/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mcarton/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mcarton/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/mcarton/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/mcarton/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/mcarton/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/mcarton/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/mcarton/rust-clippy/subscription","commits_url":"https://api.github.com/repos/mcarton/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mcarton/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mcarton/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mcarton/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mcarton/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/mcarton/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mcarton/rust-clippy/merges","archive_url":"https://api.github.com/repos/mcarton/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mcarton/rust-clippy/downloads","issues_url":"https://api.github.com/repos/mcarton/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/mcarton/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/mcarton/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/mcarton/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mcarton/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/mcarton/rust-clippy/releases{/id}","created_at":"2015-12-21T18:31:02Z","updated_at":"2016-01-19T11:06:09Z","pushed_at":"2016-01-19T20:59:55Z","git_url":"git://github.com/mcarton/rust-clippy.git","ssh_url":"git@github.com:mcarton/rust-clippy.git","clone_url":"https://github.com/mcarton/rust-clippy.git","svn_url":"https://github.com/mcarton/rust-clippy","homepage":"","size":1149,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Manishearth:master","ref":"master","sha":"6fa49eb0de256760b06a879f8240cb220b7a5435","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"repo":{"id":26850443,"name":"rust-clippy","full_name":"Manishearth/rust-clippy","owner":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Manishearth/rust-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":false,"url":"https://api.github.com/repos/Manishearth/rust-clippy","forks_url":"https://api.github.com/repos/Manishearth/rust-clippy/forks","keys_url":"https://api.github.com/repos/Manishearth/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Manishearth/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Manishearth/rust-clippy/teams","hooks_url":"https://api.github.com/repos/Manishearth/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/events","assignees_url":"https://api.github.com/repos/Manishearth/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/Manishearth/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/Manishearth/rust-clippy/tags","blobs_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/Manishearth/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/Manishearth/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/Manishearth/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/Manishearth/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/Manishearth/rust-clippy/subscription","commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Manishearth/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/Manishearth/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Manishearth/rust-clippy/merges","archive_url":"https://api.github.com/repos/Manishearth/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Manishearth/rust-clippy/downloads","issues_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/Manishearth/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/Manishearth/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/Manishearth/rust-clippy/releases{/id}","created_at":"2014-11-19T07:49:21Z","updated_at":"2016-01-19T08:28:55Z","pushed_at":"2016-01-19T20:59:55Z","git_url":"git://github.com/Manishearth/rust-clippy.git","ssh_url":"git@github.com:Manishearth/rust-clippy.git","clone_url":"https://github.com/Manishearth/rust-clippy.git","svn_url":"https://github.com/Manishearth/rust-clippy","homepage":"","size":1257,"stargazers_count":402,"watchers_count":402,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":101,"forks":54,"open_issues":101,"watchers":402,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564"},"html":{"href":"https://github.com/Manishearth/rust-clippy/pull/564"},"issue":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/issues/564"},"comments":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/issues/564/comments"},"review_comments":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564/comments"},"review_comment":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/564/commits"},"statuses":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/3b954b6cf046c6e6d411f5a2e383276db94d8abf"}}}}