{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/28811","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/28811/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/28811/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/28811/events","html_url":"https://github.com/rust-lang/rust/pull/28811","id":109520906,"number":28811,"title":"std: Add AsRef/AsMut impls to Box/Rc/Arc","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/relnotes","name":"relnotes","color":"fad8c7"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/T-libs","name":"T-libs","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"aturon","id":709807,"avatar_url":"https://avatars.githubusercontent.com/u/709807?v=3","gravatar_id":"","url":"https://api.github.com/users/aturon","html_url":"https://github.com/aturon","followers_url":"https://api.github.com/users/aturon/followers","following_url":"https://api.github.com/users/aturon/following{/other_user}","gists_url":"https://api.github.com/users/aturon/gists{/gist_id}","starred_url":"https://api.github.com/users/aturon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aturon/subscriptions","organizations_url":"https://api.github.com/users/aturon/orgs","repos_url":"https://api.github.com/users/aturon/repos","events_url":"https://api.github.com/users/aturon/events{/privacy}","received_events_url":"https://api.github.com/users/aturon/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-10-02T16:01:41Z","updated_at":"2015-10-08T02:31:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/28811","html_url":"https://github.com/rust-lang/rust/pull/28811","diff_url":"https://github.com/rust-lang/rust/pull/28811.diff","patch_url":"https://github.com/rust-lang/rust/pull/28811.patch"},"body":"These common traits were left off originally by accident from these smart\r\npointers, and a past attempt (#26008) to add them was later reverted (#26160)\r\ndue to unexpected breakge (#26096) occurring. The specific breakage in worry is\r\nthe meaning of this return value changed:\r\n\r\n    let a: Box<Option<T>> = ...;\r\n    a.as_ref()\r\n\r\nCurrently this returns `Option<&T>` but after this change it will return\r\n`&Option<T>` because the `AsRef::as_ref` method shares the same name as\r\n`Option::as_ref`. A [crater report][crater] of this change, however, has shown\r\nthat the fallout of this change is quite minimal. These trait implementations\r\nare \"the right impls to add\" to these smart pointers and would enable various\r\ngeneralizations such as those in #27197.\r\n\r\n[crater]: https://gist.github.com/anonymous/0ba4c3512b07641c0f99\r\n\r\nThis commit is a breaking change for the above reasons mentioned, and the\r\nmitigation strategies look like any of:\r\n\r\n    Option::as_ref(&a)\r\n    a.as_ref().as_ref()\r\n    (*a).as_ref()"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/146399395","html_url":"https://github.com/rust-lang/rust/pull/28811#issuecomment-146399395","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/28811","id":146399395,"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-10-08T02:31:45Z","updated_at":"2015-10-08T02:31:45Z","body":":sunny: Test successful - [auto-linux-32-nopt-t](http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/6677), [auto-linux-32-opt](http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/6691), [auto-linux-64-nopt-t](http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/6630), [auto-linux-64-opt](http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/6654), [auto-linux-64-x-android-t](http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/6633), [auto-mac-32-opt](http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/6707), [auto-mac-64-nopt-t](http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/6704), [auto-mac-64-opt](http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/6666), [auto-win-gnu-32-nopt-t](http://buildbot.rust-lang.org/builders/auto-win-gnu-32-nopt-t/builds/1657), [auto-win-gnu-32-opt](http://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt/builds/1655), [auto-win-gnu-64-nopt-t](http://buildbot.rust-lang.org/builders/auto-win-gnu-64-nopt-t/builds/1653), [auto-win-gnu-64-opt](http://buildbot.rust-lang.org/builders/auto-win-gnu-64-opt/builds/1656), [auto-win-msvc-32-opt](http://buildbot.rust-lang.org/builders/auto-win-msvc-32-opt/builds/928), [auto-win-msvc-64-opt](http://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt/builds/1638)"}}