{"action":"closed","number":2576,"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/2576","id":177535347,"html_url":"https://github.com/rust-lang-nursery/rust-clippy/pull/2576","diff_url":"https://github.com/rust-lang-nursery/rust-clippy/pull/2576.diff","patch_url":"https://github.com/rust-lang-nursery/rust-clippy/pull/2576.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2576","number":2576,"state":"closed","locked":false,"title":"while_immutable_condition: fix handling of self","user":{"login":"kimsnj","id":302132,"avatar_url":"https://avatars3.githubusercontent.com/u/302132?v=4","gravatar_id":"","url":"https://api.github.com/users/kimsnj","html_url":"https://github.com/kimsnj","followers_url":"https://api.github.com/users/kimsnj/followers","following_url":"https://api.github.com/users/kimsnj/following{/other_user}","gists_url":"https://api.github.com/users/kimsnj/gists{/gist_id}","starred_url":"https://api.github.com/users/kimsnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimsnj/subscriptions","organizations_url":"https://api.github.com/users/kimsnj/orgs","repos_url":"https://api.github.com/users/kimsnj/repos","events_url":"https://api.github.com/users/kimsnj/events{/privacy}","received_events_url":"https://api.github.com/users/kimsnj/received_events","type":"User","site_admin":false},"body":"Fixes #2540 \r\n\r\n`self` mutation was not properly handled for two reasons:\r\n-  When collection variable used in the while condition and [checking for mutability](https://github.com/rust-lang-nursery/rust-clippy/blob/eafd09010815da43302ac947afee45b0f5219e6b/clippy_lints/src/loops.rs#L1482), the annotation of the `Def` was set to No for `self` even when mutable.\r\n- The `ExprUseVisitor` calls the [`Delegate` callback](https://github.com/rust-lang-nursery/rust-clippy/blob/eafd09010815da43302ac947afee45b0f5219e6b/clippy_lints/src/loops.rs#L2216) with categorization `Deref` and not directly `Local`.\r\n\r\nWith this fix, variables of the condition are checked for mutation by their usage and not by their definition. We thus cannot have the message *\"all variables in condition are immutable\"* anymore.","created_at":"2018-03-26T18:52:03Z","updated_at":"2018-03-26T22:06:16Z","closed_at":"2018-03-26T22:06:16Z","merged_at":"2018-03-26T22:06:16Z","merge_commit_sha":"b01b0083baa758b18a3d0aece01e16c38fde2eb1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/2576/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/2576/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2576/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/statuses/737247e50e3709e0b040120dc7604362548bf8a7","head":{"label":"kimsnj:infinite_loop","ref":"infinite_loop","sha":"737247e50e3709e0b040120dc7604362548bf8a7","user":{"login":"kimsnj","id":302132,"avatar_url":"https://avatars3.githubusercontent.com/u/302132?v=4","gravatar_id":"","url":"https://api.github.com/users/kimsnj","html_url":"https://github.com/kimsnj","followers_url":"https://api.github.com/users/kimsnj/followers","following_url":"https://api.github.com/users/kimsnj/following{/other_user}","gists_url":"https://api.github.com/users/kimsnj/gists{/gist_id}","starred_url":"https://api.github.com/users/kimsnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimsnj/subscriptions","organizations_url":"https://api.github.com/users/kimsnj/orgs","repos_url":"https://api.github.com/users/kimsnj/repos","events_url":"https://api.github.com/users/kimsnj/events{/privacy}","received_events_url":"https://api.github.com/users/kimsnj/received_events","type":"User","site_admin":false},"repo":{"id":83904165,"name":"rust-clippy","full_name":"kimsnj/rust-clippy","owner":{"login":"kimsnj","id":302132,"avatar_url":"https://avatars3.githubusercontent.com/u/302132?v=4","gravatar_id":"","url":"https://api.github.com/users/kimsnj","html_url":"https://github.com/kimsnj","followers_url":"https://api.github.com/users/kimsnj/followers","following_url":"https://api.github.com/users/kimsnj/following{/other_user}","gists_url":"https://api.github.com/users/kimsnj/gists{/gist_id}","starred_url":"https://api.github.com/users/kimsnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimsnj/subscriptions","organizations_url":"https://api.github.com/users/kimsnj/orgs","repos_url":"https://api.github.com/users/kimsnj/repos","events_url":"https://api.github.com/users/kimsnj/events{/privacy}","received_events_url":"https://api.github.com/users/kimsnj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kimsnj/rust-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":true,"url":"https://api.github.com/repos/kimsnj/rust-clippy","forks_url":"https://api.github.com/repos/kimsnj/rust-clippy/forks","keys_url":"https://api.github.com/repos/kimsnj/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kimsnj/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kimsnj/rust-clippy/teams","hooks_url":"https://api.github.com/repos/kimsnj/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/kimsnj/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/kimsnj/rust-clippy/events","assignees_url":"https://api.github.com/repos/kimsnj/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/kimsnj/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/kimsnj/rust-clippy/tags","blobs_url":"https://api.github.com/repos/kimsnj/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kimsnj/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kimsnj/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kimsnj/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kimsnj/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/kimsnj/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/kimsnj/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/kimsnj/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/kimsnj/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/kimsnj/rust-clippy/subscription","commits_url":"https://api.github.com/repos/kimsnj/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kimsnj/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kimsnj/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kimsnj/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kimsnj/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/kimsnj/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kimsnj/rust-clippy/merges","archive_url":"https://api.github.com/repos/kimsnj/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kimsnj/rust-clippy/downloads","issues_url":"https://api.github.com/repos/kimsnj/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/kimsnj/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/kimsnj/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/kimsnj/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kimsnj/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/kimsnj/rust-clippy/releases{/id}","deployments_url":"https://api.github.com/repos/kimsnj/rust-clippy/deployments","created_at":"2017-03-04T15:41:10Z","updated_at":"2017-03-04T15:41:14Z","pushed_at":"2018-03-26T21:25:07Z","git_url":"git://github.com/kimsnj/rust-clippy.git","ssh_url":"git@github.com:kimsnj/rust-clippy.git","clone_url":"https://github.com/kimsnj/rust-clippy.git","svn_url":"https://github.com/kimsnj/rust-clippy","homepage":"","size":7662,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"f7c4bb69d2a9fe9c36225f6067905f3971a414ce","user":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":26850443,"name":"rust-clippy","full_name":"rust-lang-nursery/rust-clippy","owner":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang-nursery/rust-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy","forks_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/deployments","created_at":"2014-11-19T07:49:21Z","updated_at":"2018-03-26T20:50:55Z","pushed_at":"2018-03-26T22:06:17Z","git_url":"git://github.com/rust-lang-nursery/rust-clippy.git","ssh_url":"git@github.com:rust-lang-nursery/rust-clippy.git","clone_url":"https://github.com/rust-lang-nursery/rust-clippy.git","svn_url":"https://github.com/rust-lang-nursery/rust-clippy","homepage":"https://rust-lang-nursery.github.io/rust-clippy","size":8131,"stargazers_count":1972,"watchers_count":1972,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":267,"mirror_url":null,"archived":false,"open_issues_count":687,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":267,"open_issues":687,"watchers":1972,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/2576"},"html":{"href":"https://github.com/rust-lang-nursery/rust-clippy/pull/2576"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2576"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2576/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/2576/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/pulls/2576/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/statuses/737247e50e3709e0b040120dc7604362548bf8a7"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"oli-obk","id":332036,"avatar_url":"https://avatars2.githubusercontent.com/u/332036?v=4","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"comments":0,"review_comments":5,"maintainer_can_modify":false,"commits":2,"additions":86,"deletions":63,"changed_files":3}}
{"actor":{"display_login":"oli-obk"}}