{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/6393","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/6393/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/6393/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/6393/events","html_url":"https://github.com/rust-lang/rust/issues/6393","id":14199471,"number":6393,"title":"borrow scopes should not always be lexical","user":{"login":"metajack","id":28357,"avatar_url":"https://avatars.githubusercontent.com/u/28357?v=3","gravatar_id":"","url":"https://api.github.com/users/metajack","html_url":"https://github.com/metajack","followers_url":"https://api.github.com/users/metajack/followers","following_url":"https://api.github.com/users/metajack/following{/other_user}","gists_url":"https://api.github.com/users/metajack/gists{/gist_id}","starred_url":"https://api.github.com/users/metajack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metajack/subscriptions","organizations_url":"https://api.github.com/users/metajack/orgs","repos_url":"https://api.github.com/users/metajack/repos","events_url":"https://api.github.com/users/metajack/events{/privacy}","received_events_url":"https://api.github.com/users/metajack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-borrow-checker","name":"A-borrow-checker","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-papercut","name":"I-papercut","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":37,"created_at":"2013-05-10T16:51:51Z","updated_at":"2016-09-02T16:49:43Z","closed_at":"2015-04-16T20:42:31Z","body":"If you borrow immutably in an `if` test, the borrow lasts for the whole `if` expression. This means that mutable borrows in the clauses will cause the borrow checker to fail.\r\n\r\nThis can also happen when borrowing in the match expression, and needing a mutable borrow in one of the arms.\r\n\r\nSee here for an example where the if borrows boxes, which causes the nearest upwards `@mut` to freeze. Then `remove_child()` which needs to borrow mutably conflicts.\r\n\r\nhttps://github.com/mozilla/servo/blob/master/src/servo/layout/box_builder.rs#L387-L411\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/244428514","html_url":"https://github.com/rust-lang/rust/issues/6393#issuecomment-244428514","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/6393","id":244428514,"user":{"login":"metajack","id":28357,"avatar_url":"https://avatars.githubusercontent.com/u/28357?v=3","gravatar_id":"","url":"https://api.github.com/users/metajack","html_url":"https://github.com/metajack","followers_url":"https://api.github.com/users/metajack/followers","following_url":"https://api.github.com/users/metajack/following{/other_user}","gists_url":"https://api.github.com/users/metajack/gists{/gist_id}","starred_url":"https://api.github.com/users/metajack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metajack/subscriptions","organizations_url":"https://api.github.com/users/metajack/orgs","repos_url":"https://api.github.com/users/metajack/repos","events_url":"https://api.github.com/users/metajack/events{/privacy}","received_events_url":"https://api.github.com/users/metajack/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T16:49:42Z","updated_at":"2016-09-02T16:49:42Z","body":"After some digging, I believe this is equivalent to the original code:\r\nhttps://github.com/servo/servo/blob/5e406fab7ee60d9d8077d52d296f52500d72a2f6/src/servo/layout/box_builder.rs#L374"}}
{"actor":{"display_login":"metajack"}}