{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/16223","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/16223/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/16223/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/16223/events","html_url":"https://github.com/rust-lang/rust/issues/16223","id":39378116,"number":16223,"title":"Incorrect partially moved value error check when pattern matching boxed structures.","user":{"login":"csherratt","id":62622,"avatar_url":"https://avatars.githubusercontent.com/u/62622?v=3","gravatar_id":"","url":"https://api.github.com/users/csherratt","html_url":"https://github.com/csherratt","followers_url":"https://api.github.com/users/csherratt/followers","following_url":"https://api.github.com/users/csherratt/following{/other_user}","gists_url":"https://api.github.com/users/csherratt/gists{/gist_id}","starred_url":"https://api.github.com/users/csherratt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csherratt/subscriptions","organizations_url":"https://api.github.com/users/csherratt/orgs","repos_url":"https://api.github.com/users/csherratt/repos","events_url":"https://api.github.com/users/csherratt/events{/privacy}","received_events_url":"https://api.github.com/users/csherratt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-typesystem","name":"A-typesystem","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-08-03T20:07:06Z","updated_at":"2015-05-28T16:06:56Z","closed_at":null,"body":"The following code worked on `0.11` bu no longer works on `master`. Last known good nightly was August 1st.\r\n\r\n```rust\r\nstruct Foo {\r\n    a: Vec<u8>,\r\n    b: Vec<u8>\r\n}\r\n\r\nfn main() {\r\n    let foo = box Foo{a: Vec::new(), b: Vec::new()};\r\n    let Foo { a: a, b: b } = *foo;\r\n}\r\n```\r\nThis will create the following error message:\r\n```\r\n<anon>:8:24: 8:25 error: use of partially moved value: `foo.b`\r\n<anon>:8     let Foo { a: a, b: b } = *foo;\r\n                                ^\r\n<anon>:8:18: 8:19 note: `foo.a` moved here because it has type `collections::vec::Vec<u8>`, which is moved by default (use `ref` to override)\r\n<anon>:8     let Foo { a: a, b: b } = *foo;\r\n```\r\n\r\nIf `Foo` is not boxed this will function correctly.\r\n```rust\r\nstruct Foo {\r\n    a: Vec<u8>,\r\n    b: Vec<u8>\r\n}\r\n\r\nfn main() {\r\n    let foo = Foo{a: Vec::new(), b: Vec::new()};\r\n    let Foo { a: a, b: b } = foo;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/106448660","html_url":"https://github.com/rust-lang/rust/issues/16223#issuecomment-106448660","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/16223","id":106448660,"user":{"login":"brson","id":147214,"avatar_url":"https://avatars.githubusercontent.com/u/147214?v=3","gravatar_id":"","url":"https://api.github.com/users/brson","html_url":"https://github.com/brson","followers_url":"https://api.github.com/users/brson/followers","following_url":"https://api.github.com/users/brson/following{/other_user}","gists_url":"https://api.github.com/users/brson/gists{/gist_id}","starred_url":"https://api.github.com/users/brson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brson/subscriptions","organizations_url":"https://api.github.com/users/brson/orgs","repos_url":"https://api.github.com/users/brson/repos","events_url":"https://api.github.com/users/brson/events{/privacy}","received_events_url":"https://api.github.com/users/brson/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T16:06:56Z","updated_at":"2015-05-28T16:06:56Z","body":"I'm untagging all pre-1.0 regressions to repurpose it for stable regressions."}}