{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/46142","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/46142/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/46142/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/46142/events","html_url":"https://github.com/rust-lang/rust/pull/46142","id":275545880,"number":46142,"title":"MIR: split Operand::Consume into Copy and Move.","user":{"login":"eddyb","id":77424,"avatar_url":"https://avatars2.githubusercontent.com/u/77424?v=4","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/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":"nikomatsakis","id":155238,"avatar_url":"https://avatars0.githubusercontent.com/u/155238?v=4","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"assignees":[{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars0.githubusercontent.com/u/155238?v=4","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-11-21T00:33:18Z","updated_at":"2017-11-22T01:56:06Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/46142","html_url":"https://github.com/rust-lang/rust/pull/46142","diff_url":"https://github.com/rust-lang/rust/pull/46142.diff","patch_url":"https://github.com/rust-lang/rust/pull/46142.patch"},"body":"By encoding the choice of leaving the source untouched (`Copy`) and invalidating it (`Move`) in MIR, we can express moves of copyable values and have MIR borrow-checking enforce them, *including* ownership transfer of stack locals in calls  (when the ABI passes by indirection).\r\n\r\nOptimizations could turn a \"last-use\" `Copy` into a `Move`, and the MIR borrow-checker, at least within the confines of safe code, could even do this when the underlying lvalue was borrowed.\r\n(However, that last part would be the first time lifetime inference affects code generation, AFAIK).\r\n\r\nFurthermore, as `Move`s invalidate borrows as well, for any local that is initialized only once, we can ignore borrows that happened before a `Move` and safely reuse/replace its memory storage.\r\nThis will allow us to perform NRVO in the presence of short-lived borrows, unlike LLVM (currently), and even compute optimal `StorageLive...StorageDead` ranges instead of discarding them."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/346219476","html_url":"https://github.com/rust-lang/rust/pull/46142#issuecomment-346219476","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/46142","id":346219476,"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-22T01:56:05Z","updated_at":"2017-11-22T01:56:05Z","author_association":"CONTRIBUTOR","body":":umbrella: The latest upstream changes (presumably #45879) made this pull request unmergeable. Please resolve the merge conflicts."}}
{"actor":{"display_login":"bors"}}