{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/36537","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/36537/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/36537/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/36537/events","html_url":"https://github.com/rust-lang/rust/issues/36537","id":177469426,"number":36537,"title":"\"Doesn't live long enough\" error can be further improved","user":{"login":"jonathandturner","id":547158,"avatar_url":"https://avatars.githubusercontent.com/u/547158?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathandturner","html_url":"https://github.com/jonathandturner","followers_url":"https://api.github.com/users/jonathandturner/followers","following_url":"https://api.github.com/users/jonathandturner/following{/other_user}","gists_url":"https://api.github.com/users/jonathandturner/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathandturner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathandturner/subscriptions","organizations_url":"https://api.github.com/users/jonathandturner/orgs","repos_url":"https://api.github.com/users/jonathandturner/repos","events_url":"https://api.github.com/users/jonathandturner/events{/privacy}","received_events_url":"https://api.github.com/users/jonathandturner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-diagnostics","name":"A-diagnostics","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-16T16:39:34Z","updated_at":"2016-10-11T16:08:27Z","closed_at":null,"body":"From @nikomatsakis (based on a chat with @wycats) - we can further improve the \"doesn't live long enough\" error by talking a bit more about how the values flow through the error.  Something like:\r\n\r\n```\r\nerror: `x` does not live long enough\r\n --> <anon>:4:10\r\n  |\r\n4 |     p = &x;\r\n  |          - borrow occurs here\r\n5 | }\r\n  | ^ `x` dropped here while still borrowed\r\n  |\r\n= note: values in a scope are dropped in the opposite order they are created\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/252963997","html_url":"https://github.com/rust-lang/rust/issues/36537#issuecomment-252963997","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/36537","id":252963997,"user":{"login":"mikhail-m1","id":5663581,"avatar_url":"https://avatars.githubusercontent.com/u/5663581?v=3","gravatar_id":"","url":"https://api.github.com/users/mikhail-m1","html_url":"https://github.com/mikhail-m1","followers_url":"https://api.github.com/users/mikhail-m1/followers","following_url":"https://api.github.com/users/mikhail-m1/following{/other_user}","gists_url":"https://api.github.com/users/mikhail-m1/gists{/gist_id}","starred_url":"https://api.github.com/users/mikhail-m1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikhail-m1/subscriptions","organizations_url":"https://api.github.com/users/mikhail-m1/orgs","repos_url":"https://api.github.com/users/mikhail-m1/repos","events_url":"https://api.github.com/users/mikhail-m1/events{/privacy}","received_events_url":"https://api.github.com/users/mikhail-m1/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T16:08:27Z","updated_at":"2016-10-11T16:08:27Z","body":"@jonathandturner I've explored code borrow checker, and found several cases for \"does not live long enough\":\r\n1. closures,\r\n2. with same scope, like my last and your first sample\r\n3. with different scope, like my first sample\r\n\r\nShould I change only second case or third too?\r\n\r\nand I've found some uncommon construction in closure case\r\n```\r\nlet db = struct_span_error(...)\r\n...\r\ndb.span = MultiSpan::from_span(...) \r\n```\r\nCan I use it? "}}
{"actor":{"display_login":"mikhail-m1"}}