{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/33507","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/33507/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/33507/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/33507/events","html_url":"https://github.com/rust-lang/rust/issues/33507","id":153684807,"number":33507,"title":"Implement Clone for all Copy types \"by magic\"","user":{"login":"drbo","id":6395399,"avatar_url":"https://avatars.githubusercontent.com/u/6395399?v=3","gravatar_id":"","url":"https://api.github.com/users/drbo","html_url":"https://github.com/drbo","followers_url":"https://api.github.com/users/drbo/followers","following_url":"https://api.github.com/users/drbo/following{/other_user}","gists_url":"https://api.github.com/users/drbo/gists{/gist_id}","starred_url":"https://api.github.com/users/drbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drbo/subscriptions","organizations_url":"https://api.github.com/users/drbo/orgs","repos_url":"https://api.github.com/users/drbo/repos","events_url":"https://api.github.com/users/drbo/events{/privacy}","received_events_url":"https://api.github.com/users/drbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-09T00:03:00Z","updated_at":"2016-05-12T02:00:19Z","closed_at":null,"body":"This probably needs an RFC, but one solution to the problem of `Copy` not implying `Clone` is to make this happen via compiler magic: the compiler \"magically\" inserts an implementation of `Clone` for _any_ `Copy` type.\r\n\r\nGHC does something similar with `Coercible`."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/218640148","html_url":"https://github.com/rust-lang/rust/issues/33507#issuecomment-218640148","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/33507","id":218640148,"user":{"login":"drbo","id":6395399,"avatar_url":"https://avatars.githubusercontent.com/u/6395399?v=3","gravatar_id":"","url":"https://api.github.com/users/drbo","html_url":"https://github.com/drbo","followers_url":"https://api.github.com/users/drbo/followers","following_url":"https://api.github.com/users/drbo/following{/other_user}","gists_url":"https://api.github.com/users/drbo/gists{/gist_id}","starred_url":"https://api.github.com/users/drbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drbo/subscriptions","organizations_url":"https://api.github.com/users/drbo/orgs","repos_url":"https://api.github.com/users/drbo/repos","events_url":"https://api.github.com/users/drbo/events{/privacy}","received_events_url":"https://api.github.com/users/drbo/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T02:00:19Z","updated_at":"2016-05-12T02:00:19Z","body":"Yes, the idea here is to do it purely by compiler magic.  My intent is\nfor the magic to be temporary, and to be removed when it becomes\npossible to implement in libcore.\nThis is similar to the magic typing rules for std::mem::transmute (I\nbelieve that there is no other way to write code that compiles if and\nonly if two types are the same size).\nOn Tue, 2016-05-10 at 09:27 -0700, Alex Burka wrote:\n> I've never seen it tried, but yeah, whenever this comes up in the\n> context\n> of specialization that seems to be the prevailing wisdom.\n> \n> AFAIU the proposal here is to do it by magic, to eliminate concerns\n> over\n> whether specialization is powerful and/or stable enough.\n> \n> It's a good idea if we want to commit to the fact that large arrays\n> and\n> tuples WILL be Clone... somehow... eventually. It's a bad idea if we\n> could\n> contemplate fixing the bug some other way, like by making those types\n> non-Copy (a breaking change). There are also other ways to fix the\n> bug,\n> like type-level integers, or even halfway type-level integers that\n> I've\n> seen proposed (where you can impl for [T; _] but you can't refer to N\n> directly).\n> \n> On Tue, May 10, 2016 at 12:21 PM, Steven Fackler \n> b.com>\n> wrote:\n> \n> > This feels maybe doable with specialization, though I think it\n> might\n> > require the lattice rule.\n> >\n> > At the moment, we don't want to use specialization in a way that\n> adds\n> > functionality that can't exist without it since the feature's\n> unstable.\n> >\n> > —\n> > You are receiving this because you are subscribed to this thread.\n> > Reply to this email directly or view it on GitHub\n> > \n> 237>\n> >\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub\n> \n> "}}