{"action":"closed","number":51242,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/51242","id":191674932,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNjc0OTMy","html_url":"https://github.com/rust-lang/rust/pull/51242","diff_url":"https://github.com/rust-lang/rust/pull/51242.diff","patch_url":"https://github.com/rust-lang/rust/pull/51242.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/51242","number":51242,"state":"closed","locked":false,"title":"Suggest not mutably borrowing a mutable reference","user":{"login":"ytausky","id":48800,"node_id":"MDQ6VXNlcjQ4ODAw","avatar_url":"https://avatars0.githubusercontent.com/u/48800?v=4","gravatar_id":"","url":"https://api.github.com/users/ytausky","html_url":"https://github.com/ytausky","followers_url":"https://api.github.com/users/ytausky/followers","following_url":"https://api.github.com/users/ytausky/following{/other_user}","gists_url":"https://api.github.com/users/ytausky/gists{/gist_id}","starred_url":"https://api.github.com/users/ytausky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytausky/subscriptions","organizations_url":"https://api.github.com/users/ytausky/orgs","repos_url":"https://api.github.com/users/ytausky/repos","events_url":"https://api.github.com/users/ytausky/events{/privacy}","received_events_url":"https://api.github.com/users/ytausky/received_events","type":"User","site_admin":false},"body":"This PR would (hopefully) solve #45392. I deviated a bit from @estebank's instructions since the error span only included the borrowed expression (e.g. the `b` in `&mut b`). I also didn't check the mutability of the local binding, since this whole case is concerned with an immutable local.\r\n\r\nI can see two outstanding questions:\r\n1. `note_immutability_blame` is called in two places, but I only have one test case. I think it covers the call in `report_bckerror`, but I'm not sure how to trigger the call from `report_aliasability_violation`.\r\n2. There is one failing test, where the local binding is `self: &mut Self`. I'm not entirely sure what the correct output should be, but I think the new message should also apply. Unfortunately, since this parameter is parsed differently, its `let_span` covers both the pattern and the type, leading to a wrong suggestion text. I'm not sure how to correctly identify this case.","created_at":"2018-05-31T08:09:24Z","updated_at":"2018-06-05T04:28:06Z","closed_at":"2018-06-05T04:28:06Z","merged_at":"2018-06-05T04:28:06Z","merge_commit_sha":"3303e6847b4e8b413ec65a166337e5f9f8325f28","assignee":{"login":"estebank","id":1606434,"node_id":"MDQ6VXNlcjE2MDY0MzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1606434?v=4","gravatar_id":"","url":"https://api.github.com/users/estebank","html_url":"https://github.com/estebank","followers_url":"https://api.github.com/users/estebank/followers","following_url":"https://api.github.com/users/estebank/following{/other_user}","gists_url":"https://api.github.com/users/estebank/gists{/gist_id}","starred_url":"https://api.github.com/users/estebank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estebank/subscriptions","organizations_url":"https://api.github.com/users/estebank/orgs","repos_url":"https://api.github.com/users/estebank/repos","events_url":"https://api.github.com/users/estebank/events{/privacy}","received_events_url":"https://api.github.com/users/estebank/received_events","type":"User","site_admin":false},"assignees":[{"login":"estebank","id":1606434,"node_id":"MDQ6VXNlcjE2MDY0MzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1606434?v=4","gravatar_id":"","url":"https://api.github.com/users/estebank","html_url":"https://github.com/estebank","followers_url":"https://api.github.com/users/estebank/followers","following_url":"https://api.github.com/users/estebank/following{/other_user}","gists_url":"https://api.github.com/users/estebank/gists{/gist_id}","starred_url":"https://api.github.com/users/estebank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estebank/subscriptions","organizations_url":"https://api.github.com/users/estebank/orgs","repos_url":"https://api.github.com/users/estebank/repos","events_url":"https://api.github.com/users/estebank/events{/privacy}","received_events_url":"https://api.github.com/users/estebank/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":583437191,"node_id":"MDU6TGFiZWw1ODM0MzcxOTE=","url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-bors","name":"S-waiting-on-bors","color":"d3dddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/51242/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/51242/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/51242/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/3303e6847b4e8b413ec65a166337e5f9f8325f28","head":{"label":"ytausky:mut-ref","ref":"mut-ref","sha":"3303e6847b4e8b413ec65a166337e5f9f8325f28","user":{"login":"ytausky","id":48800,"node_id":"MDQ6VXNlcjQ4ODAw","avatar_url":"https://avatars0.githubusercontent.com/u/48800?v=4","gravatar_id":"","url":"https://api.github.com/users/ytausky","html_url":"https://github.com/ytausky","followers_url":"https://api.github.com/users/ytausky/followers","following_url":"https://api.github.com/users/ytausky/following{/other_user}","gists_url":"https://api.github.com/users/ytausky/gists{/gist_id}","starred_url":"https://api.github.com/users/ytausky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytausky/subscriptions","organizations_url":"https://api.github.com/users/ytausky/orgs","repos_url":"https://api.github.com/users/ytausky/repos","events_url":"https://api.github.com/users/ytausky/events{/privacy}","received_events_url":"https://api.github.com/users/ytausky/received_events","type":"User","site_admin":false},"repo":{"id":132671161,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI2NzExNjE=","name":"rust","full_name":"ytausky/rust","owner":{"login":"ytausky","id":48800,"node_id":"MDQ6VXNlcjQ4ODAw","avatar_url":"https://avatars0.githubusercontent.com/u/48800?v=4","gravatar_id":"","url":"https://api.github.com/users/ytausky","html_url":"https://github.com/ytausky","followers_url":"https://api.github.com/users/ytausky/followers","following_url":"https://api.github.com/users/ytausky/following{/other_user}","gists_url":"https://api.github.com/users/ytausky/gists{/gist_id}","starred_url":"https://api.github.com/users/ytausky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytausky/subscriptions","organizations_url":"https://api.github.com/users/ytausky/orgs","repos_url":"https://api.github.com/users/ytausky/repos","events_url":"https://api.github.com/users/ytausky/events{/privacy}","received_events_url":"https://api.github.com/users/ytausky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ytausky/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/ytausky/rust","forks_url":"https://api.github.com/repos/ytausky/rust/forks","keys_url":"https://api.github.com/repos/ytausky/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ytausky/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ytausky/rust/teams","hooks_url":"https://api.github.com/repos/ytausky/rust/hooks","issue_events_url":"https://api.github.com/repos/ytausky/rust/issues/events{/number}","events_url":"https://api.github.com/repos/ytausky/rust/events","assignees_url":"https://api.github.com/repos/ytausky/rust/assignees{/user}","branches_url":"https://api.github.com/repos/ytausky/rust/branches{/branch}","tags_url":"https://api.github.com/repos/ytausky/rust/tags","blobs_url":"https://api.github.com/repos/ytausky/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ytausky/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ytausky/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/ytausky/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ytausky/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/ytausky/rust/languages","stargazers_url":"https://api.github.com/repos/ytausky/rust/stargazers","contributors_url":"https://api.github.com/repos/ytausky/rust/contributors","subscribers_url":"https://api.github.com/repos/ytausky/rust/subscribers","subscription_url":"https://api.github.com/repos/ytausky/rust/subscription","commits_url":"https://api.github.com/repos/ytausky/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/ytausky/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/ytausky/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/ytausky/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/ytausky/rust/contents/{+path}","compare_url":"https://api.github.com/repos/ytausky/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ytausky/rust/merges","archive_url":"https://api.github.com/repos/ytausky/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ytausky/rust/downloads","issues_url":"https://api.github.com/repos/ytausky/rust/issues{/number}","pulls_url":"https://api.github.com/repos/ytausky/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/ytausky/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/ytausky/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ytausky/rust/labels{/name}","releases_url":"https://api.github.com/repos/ytausky/rust/releases{/id}","deployments_url":"https://api.github.com/repos/ytausky/rust/deployments","created_at":"2018-05-08T22:18:13Z","updated_at":"2018-06-01T21:15:12Z","pushed_at":"2018-06-01T21:19:30Z","git_url":"git://github.com/ytausky/rust.git","ssh_url":"git@github.com:ytausky/rust.git","clone_url":"https://github.com/ytausky/rust.git","svn_url":"https://github.com/ytausky/rust","homepage":"https://www.rust-lang.org","size":373034,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"aa094a43cc041c8483b7c80fb0ec4be233dd01b7","user":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"node_id":"MDEwOlJlcG9zaXRvcnk3MjQ3MTI=","name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rust/deployments","created_at":"2010-06-16T20:39:03Z","updated_at":"2018-06-05T03:49:23Z","pushed_at":"2018-06-05T04:27:56Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"https://www.rust-lang.org","size":373805,"stargazers_count":28570,"watchers_count":28570,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4960,"mirror_url":null,"archived":false,"open_issues_count":3833,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4960,"open_issues":3833,"watchers":28570,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/51242"},"html":{"href":"https://github.com/rust-lang/rust/pull/51242"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/51242"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/51242/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/51242/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/51242/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/3303e6847b4e8b413ec65a166337e5f9f8325f28"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"bors","id":3372342,"node_id":"MDQ6VXNlcjMzNzIzNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/3372342?v=4","gravatar_id":"","url":"https://api.github.com/users/bors","html_url":"https://github.com/bors","followers_url":"https://api.github.com/users/bors/followers","following_url":"https://api.github.com/users/bors/following{/other_user}","gists_url":"https://api.github.com/users/bors/gists{/gist_id}","starred_url":"https://api.github.com/users/bors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors/subscriptions","organizations_url":"https://api.github.com/users/bors/orgs","repos_url":"https://api.github.com/users/bors/repos","events_url":"https://api.github.com/users/bors/events{/privacy}","received_events_url":"https://api.github.com/users/bors/received_events","type":"User","site_admin":false},"comments":11,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":114,"deletions":39,"changed_files":6}}
{"actor":{"display_login":"bors"}}