{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/811","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/811/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/811/events","html_url":"https://github.com/rust-lang/rfcs/issues/811","id":56738320,"number":811,"title":"Non-lexical borrow scopes and better treatment of nested method calls","user":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/postponed","name":"postponed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2015-02-05T22:14:59Z","updated_at":"2016-07-19T20:21:23Z","closed_at":null,"body":"In general, it can be useful to have support for borrows that aren't tied to lexical scopes.\r\n\r\nRelated links:\r\n- Nested method calls with `&mut` receivers result in borrowck errors (rust-lang/rust#6268)\r\n- Borrow scopes should not always be lexical (rust-lang/rust#6393)\r\n- Single-entry, multiple-exit regions for borrows (#396) \r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/233753607","html_url":"https://github.com/rust-lang/rfcs/issues/811#issuecomment-233753607","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/811","id":233753607,"user":{"login":"ehiggs","id":28823,"avatar_url":"https://avatars.githubusercontent.com/u/28823?v=3","gravatar_id":"","url":"https://api.github.com/users/ehiggs","html_url":"https://github.com/ehiggs","followers_url":"https://api.github.com/users/ehiggs/followers","following_url":"https://api.github.com/users/ehiggs/following{/other_user}","gists_url":"https://api.github.com/users/ehiggs/gists{/gist_id}","starred_url":"https://api.github.com/users/ehiggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehiggs/subscriptions","organizations_url":"https://api.github.com/users/ehiggs/orgs","repos_url":"https://api.github.com/users/ehiggs/repos","events_url":"https://api.github.com/users/ehiggs/events{/privacy}","received_events_url":"https://api.github.com/users/ehiggs/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T20:21:23Z","updated_at":"2016-07-19T20:21:23Z","body":"Is it possible to have something like:\r\n\r\n```rust\r\nfn main() {\r\n    let a = 1;\r\n    let c;\r\n    {\r\n        let b = &mut a;\r\n        c = SomethingThatHasSideEffectsOnDrop::new(&*b);\r\n    }\r\n    side_effect_function(\"called before c is dropped?\");\r\n    let d = &a;\r\n}\r\n```"}}
{"actor":{"display_login":"ehiggs"}}