{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/22086","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/22086/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/22086/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/22086/events","html_url":"https://github.com/rust-lang/rust/pull/22086","id":56950008,"number":22086,"title":"overloaded-`box` protocol changes","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":[],"state":"open","locked":false,"assignee":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","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":18,"created_at":"2015-02-08T12:32:43Z","updated_at":"2015-03-12T22:46:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/22086","html_url":"https://github.com/rust-lang/rust/pull/22086","diff_url":"https://github.com/rust-lang/rust/pull/22086.diff","patch_url":"https://github.com/rust-lang/rust/pull/22086.patch"},"body":"This is a bootstrapping illustration of the new box prototype.  The main point is to illustrate the fallout that occurs with the compiler type inference as it (nearly) stands today.  (Note that much of that fallout has now landed in PR #23002.)\r\n\r\nThis PR is a revised version of PR #22006, building upon PR #22012 to remove much (but certainly not all) of the fallout observed there.\r\n\r\nNow most of the fallout in this PR is from where `box <expr>` was being used in contexts that are implicitly coerced to `Box<Trait>`, which is not compatible with the new box protocol (at least, not yet), since the use of coercion there subverts the box-protocol's attempt to infer the appropriate boxed-type to create.  (This is noted at [this comment](https://github.com/rust-lang/rfcs/pull/809#issuecomment-73335012) on the RFC.)\r\n * [Here is a self-contained gist](https://gist.github.com/pnkfelix/abee2f0cbdca677b6f01), runnable in the playpen, that demonstrates the issue (though note the `cfg(works)` only actually \"works\" atop PR #22012), with method names that reflect where I originally found in this in the `libsyntax` crate.\r\n * And [here is a second gist](https://gist.github.com/pnkfelix/ab38c798aecaeaf48e57) that is a bit more narrowly focused on the `impl` I found of `Default for Box<[T]>`, which may or may not be an instance of the same problem.\r\n\r\nFor now, I am usually getting around this by using `Box::new(..)`;\r\n * it is worth noting that `in HEAP { <expr> }` can often fix such cases, but not always;\r\n * `Box::new(<expr>)` always works, though it may introduce an intermediate copy that could have been otherwise avoided.\r\n\r\n----\r\n\r\nsee also https://github.com/rust-lang/rfcs/pull/809 (which is now merged as of this (updated) writing).\r\n\r\n----\r\n\r\noh, and \r\n\r\n[breaking-change]"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/78670457","html_url":"https://github.com/rust-lang/rust/pull/22086#issuecomment-78670457","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/22086","id":78670457,"user":{"login":"bors","id":3372342,"avatar_url":"https://avatars.githubusercontent.com/u/3372342?v=3","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":"2015-03-12T22:46:35Z","updated_at":"2015-03-12T22:46:35Z","body":":umbrella: The latest upstream changes (presumably #23265) made this pull request unmergeable. Please resolve the merge conflicts."}}