{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/230023687","pull_request_review_id":170660996,"id":230023687,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDAyMzY4Nw==","diff_hunk":"@@ -1512,16 +1512,14 @@ impl<T: ?Sized> UnsafeCell<T> {\n     }\n }\n \n-// TODO: correct stable attribute\n-#[stable(feature = \"rust1\", since = \"1.0.0\")]\n-impl<T: Clone> Clone for UnsafeCell<T> {\n+#[stable(feature = \"unsafe_cell_copy_clone_conservative\", since = \"1.31.0\")]\n+impl<T: Clone + Copy> Clone for UnsafeCell<T> {\n     fn clone(&self) -> UnsafeCell<T> {\n         UnsafeCell::new(self.value.clone())","path":"src/libcore/cell.rs","position":null,"original_position":10,"commit_id":"67bcac6665d21c686f500b79fe3efecb09913198","original_commit_id":"4676b10670caa926d9eab2586060068095d255ce","user":{"login":"jamesmunns","id":2097964,"node_id":"MDQ6VXNlcjIwOTc5NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2097964?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmunns","html_url":"https://github.com/jamesmunns","followers_url":"https://api.github.com/users/jamesmunns/followers","following_url":"https://api.github.com/users/jamesmunns/following{/other_user}","gists_url":"https://api.github.com/users/jamesmunns/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmunns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmunns/subscriptions","organizations_url":"https://api.github.com/users/jamesmunns/orgs","repos_url":"https://api.github.com/users/jamesmunns/repos","events_url":"https://api.github.com/users/jamesmunns/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmunns/received_events","type":"User","site_admin":false},"body":"@RalfJung impl'd in 67bcac6, thanks!","created_at":"2018-11-01T12:20:11Z","updated_at":"2018-11-01T12:20:11Z","html_url":"https://github.com/rust-lang/rust/pull/55207#discussion_r230023687","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/55207","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/230023687"},"html":{"href":"https://github.com/rust-lang/rust/pull/55207#discussion_r230023687"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/55207"}},"in_reply_to_id":230021577},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/55207","id":224342260,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MzQyMjYw","html_url":"https://github.com/rust-lang/rust/pull/55207","diff_url":"https://github.com/rust-lang/rust/pull/55207.diff","patch_url":"https://github.com/rust-lang/rust/pull/55207.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/55207","number":55207,"state":"open","locked":false,"title":"Implement Copy and Clone for UnsafeCell<T>","user":{"login":"jamesmunns","id":2097964,"node_id":"MDQ6VXNlcjIwOTc5NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2097964?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmunns","html_url":"https://github.com/jamesmunns","followers_url":"https://api.github.com/users/jamesmunns/followers","following_url":"https://api.github.com/users/jamesmunns/following{/other_user}","gists_url":"https://api.github.com/users/jamesmunns/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmunns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmunns/subscriptions","organizations_url":"https://api.github.com/users/jamesmunns/orgs","repos_url":"https://api.github.com/users/jamesmunns/repos","events_url":"https://api.github.com/users/jamesmunns/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmunns/received_events","type":"User","site_admin":false},"body":"This change implements Copy and Clone for `UnsafeCell<T>`, if `T` implements Copy and/or Clone.\r\n\r\nI am opening this as a PR, rather than as an RFC, because I am unsure whether this falls under the category of \"Nontrivial trait impl (because all trait impls are insta-stable)\" or \"Implementing an \"obvious\" trait like Clone/Debug/etc\", and the guide suggests to do whatever is easier. I am happy to close this PR and write a full RFC, if necessary.\r\n\r\nI believe this is sound, as `UnsafeCell<T>` does not provide public access to `self.value`, and the accessor methods `get()` and `set()` always refer to item contained within self. Therefore if the contained item can be cloned or copied, I believe the containing Cell should also be able to copied or cloned.\r\n\r\nThe motivation for this change is to allow the use of `UnsafeCell<T>` in static arrays, using the `[T; N]` syntax. For this syntax to work, `T` must be `Copy`. For example, if we wanted to make an array of `[UnsafeCell<u16>; 128]`, it would be necessary to fully type out the initializer 128 times, which is not desirable, and difficult to do at global scope with a const_fn or macro.\r\n\r\nAs of now, the `#[stable]` attribute is incorrect, and must be fixed before merging. I would also appreciate guidance on how to fill this out.","created_at":"2018-10-19T16:23:49Z","updated_at":"2018-11-01T12:20:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5a1809dab27e776435b013e7ec4fe297ace6889","assignee":{"login":"aidanhs","id":1050652,"node_id":"MDQ6VXNlcjEwNTA2NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1050652?v=4","gravatar_id":"","url":"https://api.github.com/users/aidanhs","html_url":"https://github.com/aidanhs","followers_url":"https://api.github.com/users/aidanhs/followers","following_url":"https://api.github.com/users/aidanhs/following{/other_user}","gists_url":"https://api.github.com/users/aidanhs/gists{/gist_id}","starred_url":"https://api.github.com/users/aidanhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidanhs/subscriptions","organizations_url":"https://api.github.com/users/aidanhs/orgs","repos_url":"https://api.github.com/users/aidanhs/repos","events_url":"https://api.github.com/users/aidanhs/events{/privacy}","received_events_url":"https://api.github.com/users/aidanhs/received_events","type":"User","site_admin":false},"assignees":[{"login":"aidanhs","id":1050652,"node_id":"MDQ6VXNlcjEwNTA2NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1050652?v=4","gravatar_id":"","url":"https://api.github.com/users/aidanhs","html_url":"https://github.com/aidanhs","followers_url":"https://api.github.com/users/aidanhs/followers","following_url":"https://api.github.com/users/aidanhs/following{/other_user}","gists_url":"https://api.github.com/users/aidanhs/gists{/gist_id}","starred_url":"https://api.github.com/users/aidanhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidanhs/subscriptions","organizations_url":"https://api.github.com/users/aidanhs/orgs","repos_url":"https://api.github.com/users/aidanhs/repos","events_url":"https://api.github.com/users/aidanhs/events{/privacy}","received_events_url":"https://api.github.com/users/aidanhs/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":583426710,"node_id":"MDU6TGFiZWw1ODM0MjY3MTA=","url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-review","name":"S-waiting-on-review","color":"d3dddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/55207/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/55207/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/55207/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/67bcac6665d21c686f500b79fe3efecb09913198","head":{"label":"jamesmunns:unsafe-cell-copy-clone","ref":"unsafe-cell-copy-clone","sha":"67bcac6665d21c686f500b79fe3efecb09913198","user":{"login":"jamesmunns","id":2097964,"node_id":"MDQ6VXNlcjIwOTc5NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2097964?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmunns","html_url":"https://github.com/jamesmunns","followers_url":"https://api.github.com/users/jamesmunns/followers","following_url":"https://api.github.com/users/jamesmunns/following{/other_user}","gists_url":"https://api.github.com/users/jamesmunns/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmunns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmunns/subscriptions","organizations_url":"https://api.github.com/users/jamesmunns/orgs","repos_url":"https://api.github.com/users/jamesmunns/repos","events_url":"https://api.github.com/users/jamesmunns/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmunns/received_events","type":"User","site_admin":false},"repo":{"id":153809661,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM4MDk2NjE=","name":"rust","full_name":"jamesmunns/rust","private":false,"owner":{"login":"jamesmunns","id":2097964,"node_id":"MDQ6VXNlcjIwOTc5NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2097964?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmunns","html_url":"https://github.com/jamesmunns","followers_url":"https://api.github.com/users/jamesmunns/followers","following_url":"https://api.github.com/users/jamesmunns/following{/other_user}","gists_url":"https://api.github.com/users/jamesmunns/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmunns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmunns/subscriptions","organizations_url":"https://api.github.com/users/jamesmunns/orgs","repos_url":"https://api.github.com/users/jamesmunns/repos","events_url":"https://api.github.com/users/jamesmunns/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmunns/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jamesmunns/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/jamesmunns/rust","forks_url":"https://api.github.com/repos/jamesmunns/rust/forks","keys_url":"https://api.github.com/repos/jamesmunns/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamesmunns/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamesmunns/rust/teams","hooks_url":"https://api.github.com/repos/jamesmunns/rust/hooks","issue_events_url":"https://api.github.com/repos/jamesmunns/rust/issues/events{/number}","events_url":"https://api.github.com/repos/jamesmunns/rust/events","assignees_url":"https://api.github.com/repos/jamesmunns/rust/assignees{/user}","branches_url":"https://api.github.com/repos/jamesmunns/rust/branches{/branch}","tags_url":"https://api.github.com/repos/jamesmunns/rust/tags","blobs_url":"https://api.github.com/repos/jamesmunns/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamesmunns/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamesmunns/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamesmunns/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamesmunns/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/jamesmunns/rust/languages","stargazers_url":"https://api.github.com/repos/jamesmunns/rust/stargazers","contributors_url":"https://api.github.com/repos/jamesmunns/rust/contributors","subscribers_url":"https://api.github.com/repos/jamesmunns/rust/subscribers","subscription_url":"https://api.github.com/repos/jamesmunns/rust/subscription","commits_url":"https://api.github.com/repos/jamesmunns/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamesmunns/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamesmunns/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamesmunns/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/jamesmunns/rust/contents/{+path}","compare_url":"https://api.github.com/repos/jamesmunns/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamesmunns/rust/merges","archive_url":"https://api.github.com/repos/jamesmunns/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamesmunns/rust/downloads","issues_url":"https://api.github.com/repos/jamesmunns/rust/issues{/number}","pulls_url":"https://api.github.com/repos/jamesmunns/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/jamesmunns/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/jamesmunns/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamesmunns/rust/labels{/name}","releases_url":"https://api.github.com/repos/jamesmunns/rust/releases{/id}","deployments_url":"https://api.github.com/repos/jamesmunns/rust/deployments","created_at":"2018-10-19T16:11:02Z","updated_at":"2018-10-19T16:11:34Z","pushed_at":"2018-11-01T12:18:42Z","git_url":"git://github.com/jamesmunns/rust.git","ssh_url":"git@github.com:jamesmunns/rust.git","clone_url":"https://github.com/jamesmunns/rust.git","svn_url":"https://github.com/jamesmunns/rust","homepage":"https://www.rust-lang.org","size":398479,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"74ff7dcb1388e60a613cd6050bcd372a3cc4998b","user":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"node_id":"MDEwOlJlcG9zaXRvcnk3MjQ3MTI=","name":"rust","full_name":"rust-lang/rust","private":false,"owner":{"login":"rust-lang","id":5430905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MzA5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rust/deployments","created_at":"2010-06-16T20:39:03Z","updated_at":"2018-11-01T11:55:07Z","pushed_at":"2018-11-01T12:18:45Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"https://www.rust-lang.org","size":400986,"stargazers_count":31461,"watchers_count":31461,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5263,"mirror_url":null,"archived":false,"open_issues_count":4496,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5263,"open_issues":4496,"watchers":31461,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/55207"},"html":{"href":"https://github.com/rust-lang/rust/pull/55207"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/55207"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/55207/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/55207/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/55207/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/67bcac6665d21c686f500b79fe3efecb09913198"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jamesmunns"}}