{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/45927","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/45927/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/45927/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/45927/events","html_url":"https://github.com/rust-lang/rust/pull/45927","id":273132997,"number":45927,"title":"MIR-borrowck: fix diagnostics for closures","user":{"login":"sinkuu","id":7091080,"avatar_url":"https://avatars0.githubusercontent.com/u/7091080?v=4","gravatar_id":"","url":"https://api.github.com/users/sinkuu","html_url":"https://github.com/sinkuu","followers_url":"https://api.github.com/users/sinkuu/followers","following_url":"https://api.github.com/users/sinkuu/following{/other_user}","gists_url":"https://api.github.com/users/sinkuu/gists{/gist_id}","starred_url":"https://api.github.com/users/sinkuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinkuu/subscriptions","organizations_url":"https://api.github.com/users/sinkuu/orgs","repos_url":"https://api.github.com/users/sinkuu/repos","events_url":"https://api.github.com/users/sinkuu/events{/privacy}","received_events_url":"https://api.github.com/users/sinkuu/received_events","type":"User","site_admin":false},"labels":[{"id":583426710,"url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-review","name":"S-waiting-on-review","color":"d3dddd","default":false}],"state":"open","locked":false,"assignee":{"login":"estebank","id":1606434,"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,"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}],"milestone":null,"comments":2,"created_at":"2017-11-11T09:32:58Z","updated_at":"2017-11-13T06:11:46Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/45927","html_url":"https://github.com/rust-lang/rust/pull/45927","diff_url":"https://github.com/rust-lang/rust/pull/45927.diff","patch_url":"https://github.com/rust-lang/rust/pull/45927.patch"},"body":"Emit notes for captured variables in the same manner as AST borrowck.\r\n\r\n```\r\nerror[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)\r\n  --> $DIR/borrowck-closures-two-mut.rs:24:24\r\n   |\r\n23 |     let c1 = to_fn_mut(|| x = 4);\r\n   |                        -- - previous borrow occurs due to use of `x` in closure\r\n   |                        |\r\n   |                        first mutable borrow occurs here\r\n24 |     let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once\r\n   |                        ^^ - borrow occurs due to use of `x` in closure\r\n   |                        |\r\n   |                        second mutable borrow occurs here\r\n25 | }\r\n   | - first borrow ends here\r\n\r\nerror[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)\r\n  --> $DIR/borrowck-closures-two-mut.rs:24:24\r\n   |\r\n23 |     let c1 = to_fn_mut(|| x = 4);\r\n   |                        -- - previous borrow occurs due to use of `x` in closure\r\n   |                        |\r\n   |                        first mutable borrow occurs here\r\n24 |     let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once\r\n   |                        ^^ - borrow occurs due to use of `x` in closure\r\n   |                        |\r\n   |                        second mutable borrow occurs here\r\n25 | }\r\n   | - first borrow ends here\r\n```\r\n\r\n \r\nFixes #45362."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/343823563","html_url":"https://github.com/rust-lang/rust/pull/45927#issuecomment-343823563","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/45927","id":343823563,"user":{"login":"bors","id":3372342,"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},"created_at":"2017-11-13T06:11:46Z","updated_at":"2017-11-13T06:11:46Z","author_association":"CONTRIBUTOR","body":":pushpin: Commit f99142b has been approved by `estebank`\n\n<!-- @bors r=estebank f99142b977bc6e22aa3937f95a799490df735c7b -->"}}
{"actor":{"display_login":"bors"}}