{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/41867985","id":41867985,"diff_hunk":"@@ -12,6 +12,98 @@\n \n register_long_diagnostics! {\n \n+E0510: r##\"\n+`return_address` was used in an invalid context. Erroneous code example:\n+\n+```\n+extern \"rust-intrinsic\" {\n+    fn return_address() -> *const u8;\n+}\n+\n+pub unsafe fn by_value() -> i32 {\n+    let _ = return_address();\n+    // error: invalid use of `return_address` intrinsic: function does\n+    //        not use out pointer\n+    0\n+}\n+```\n+\n+Return values may be stored in a return register(s) or written into a so-called\n+out pointer. In case the returned value is big enough (this is\n+target-ABI-dependent and generally not portable or future proof) to not fit\n+into the return register(s), the compiler will return value by writing it into\n+space allocated in the caller's stack frame. Example:\n+\n+```\n+extern \"rust-intrinsic\" {\n+    fn return_address() -> *const u8;\n+}\n+\n+pub unsafe fn by_pointer() -> String {\n+    let _ = return_address();\n+    String::new() // ok!\n+}\n+```\n+\"##,\n+\n+E0511: r##\"\n+Invalid monomorphization of an intrinsic function was used. Erroneous code\n+example:\n+\n+```\n+extern \"platform-intrinsic\" {\n+    fn simd_add<T>(a: T, b: T) -> T;\n+}\n+\n+unsafe { simd_add(0, 1); }\n+// error: invalid monomorphization of `simd_add` intrinsic\n+```\n+\n+The generic type has to be a SIMD type. Example:\n+\n+```\n+#[repr(simd)]\n+#[derive(Copy, Clone)]\n+struct i32x1(i32);\n+\n+extern \"platform-intrinsic\" {\n+    fn simd_add<T>(a: T, b: T) -> T;\n+}\n+\n+unsafe { simd_add(i32x1(0), i32x1(1)); } // ok!\n+```\n+\"##,\n+\n+E0512: r##\"\n+Transmute with two differently sized types was attempted. Erroneous code\n+example:\n+\n+```\n+extern \"rust-intrinsic\" {\n+    pub fn ctpop8(x: u8) -> u8;\n+}\n+\n+fn main() {\n+    unsafe { ctpop8(::std::mem::transmute(0u16)); }\n+    // error: transmute called with differently sized types\n+}\n+```\n+\n+Please use types with same size or use the awaited type directly. Example:","path":"src/librustc_trans/diagnostics.rs","position":81,"original_position":81,"commit_id":"881b6c1493dcd9468207c64eccbe8c050b1d6cb5","original_commit_id":"881b6c1493dcd9468207c64eccbe8c050b1d6cb5","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},"body":"\"awaited type\" ?\r\n\r\nI suspect \"target type\" or \"expected type\" would be better.","created_at":"2015-10-13T13:57:16Z","updated_at":"2015-10-13T13:57:16Z","html_url":"https://github.com/rust-lang/rust/pull/28909#discussion_r41867985","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/28909","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/41867985"},"html":{"href":"https://github.com/rust-lang/rust/pull/28909#discussion_r41867985"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28909"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/28909","id":47133192,"html_url":"https://github.com/rust-lang/rust/pull/28909","diff_url":"https://github.com/rust-lang/rust/pull/28909.diff","patch_url":"https://github.com/rust-lang/rust/pull/28909.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/28909","number":28909,"state":"open","locked":false,"title":"Add E0510, E0511 and E0512 error explanations","user":{"login":"GuillaumeGomez","id":3050060,"avatar_url":"https://avatars.githubusercontent.com/u/3050060?v=3","gravatar_id":"","url":"https://api.github.com/users/GuillaumeGomez","html_url":"https://github.com/GuillaumeGomez","followers_url":"https://api.github.com/users/GuillaumeGomez/followers","following_url":"https://api.github.com/users/GuillaumeGomez/following{/other_user}","gists_url":"https://api.github.com/users/GuillaumeGomez/gists{/gist_id}","starred_url":"https://api.github.com/users/GuillaumeGomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuillaumeGomez/subscriptions","organizations_url":"https://api.github.com/users/GuillaumeGomez/orgs","repos_url":"https://api.github.com/users/GuillaumeGomez/repos","events_url":"https://api.github.com/users/GuillaumeGomez/events{/privacy}","received_events_url":"https://api.github.com/users/GuillaumeGomez/received_events","type":"User","site_admin":false},"body":"r? @Manishearth ","created_at":"2015-10-08T10:01:24Z","updated_at":"2015-10-13T13:57:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12abdfcfc3b351d32fd00f2170bd2463eedf9a3b","assignee":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/28909/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/28909/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/28909/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/881b6c1493dcd9468207c64eccbe8c050b1d6cb5","head":{"label":"GuillaumeGomez:patch-3","ref":"patch-3","sha":"881b6c1493dcd9468207c64eccbe8c050b1d6cb5","user":{"login":"GuillaumeGomez","id":3050060,"avatar_url":"https://avatars.githubusercontent.com/u/3050060?v=3","gravatar_id":"","url":"https://api.github.com/users/GuillaumeGomez","html_url":"https://github.com/GuillaumeGomez","followers_url":"https://api.github.com/users/GuillaumeGomez/followers","following_url":"https://api.github.com/users/GuillaumeGomez/following{/other_user}","gists_url":"https://api.github.com/users/GuillaumeGomez/gists{/gist_id}","starred_url":"https://api.github.com/users/GuillaumeGomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuillaumeGomez/subscriptions","organizations_url":"https://api.github.com/users/GuillaumeGomez/orgs","repos_url":"https://api.github.com/users/GuillaumeGomez/repos","events_url":"https://api.github.com/users/GuillaumeGomez/events{/privacy}","received_events_url":"https://api.github.com/users/GuillaumeGomez/received_events","type":"User","site_admin":false},"repo":{"id":32751288,"name":"rust","full_name":"GuillaumeGomez/rust","owner":{"login":"GuillaumeGomez","id":3050060,"avatar_url":"https://avatars.githubusercontent.com/u/3050060?v=3","gravatar_id":"","url":"https://api.github.com/users/GuillaumeGomez","html_url":"https://github.com/GuillaumeGomez","followers_url":"https://api.github.com/users/GuillaumeGomez/followers","following_url":"https://api.github.com/users/GuillaumeGomez/following{/other_user}","gists_url":"https://api.github.com/users/GuillaumeGomez/gists{/gist_id}","starred_url":"https://api.github.com/users/GuillaumeGomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuillaumeGomez/subscriptions","organizations_url":"https://api.github.com/users/GuillaumeGomez/orgs","repos_url":"https://api.github.com/users/GuillaumeGomez/repos","events_url":"https://api.github.com/users/GuillaumeGomez/events{/privacy}","received_events_url":"https://api.github.com/users/GuillaumeGomez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GuillaumeGomez/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/GuillaumeGomez/rust","forks_url":"https://api.github.com/repos/GuillaumeGomez/rust/forks","keys_url":"https://api.github.com/repos/GuillaumeGomez/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GuillaumeGomez/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GuillaumeGomez/rust/teams","hooks_url":"https://api.github.com/repos/GuillaumeGomez/rust/hooks","issue_events_url":"https://api.github.com/repos/GuillaumeGomez/rust/issues/events{/number}","events_url":"https://api.github.com/repos/GuillaumeGomez/rust/events","assignees_url":"https://api.github.com/repos/GuillaumeGomez/rust/assignees{/user}","branches_url":"https://api.github.com/repos/GuillaumeGomez/rust/branches{/branch}","tags_url":"https://api.github.com/repos/GuillaumeGomez/rust/tags","blobs_url":"https://api.github.com/repos/GuillaumeGomez/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GuillaumeGomez/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GuillaumeGomez/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/GuillaumeGomez/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GuillaumeGomez/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/GuillaumeGomez/rust/languages","stargazers_url":"https://api.github.com/repos/GuillaumeGomez/rust/stargazers","contributors_url":"https://api.github.com/repos/GuillaumeGomez/rust/contributors","subscribers_url":"https://api.github.com/repos/GuillaumeGomez/rust/subscribers","subscription_url":"https://api.github.com/repos/GuillaumeGomez/rust/subscription","commits_url":"https://api.github.com/repos/GuillaumeGomez/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/GuillaumeGomez/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/GuillaumeGomez/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/GuillaumeGomez/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/GuillaumeGomez/rust/contents/{+path}","compare_url":"https://api.github.com/repos/GuillaumeGomez/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GuillaumeGomez/rust/merges","archive_url":"https://api.github.com/repos/GuillaumeGomez/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GuillaumeGomez/rust/downloads","issues_url":"https://api.github.com/repos/GuillaumeGomez/rust/issues{/number}","pulls_url":"https://api.github.com/repos/GuillaumeGomez/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/GuillaumeGomez/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/GuillaumeGomez/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GuillaumeGomez/rust/labels{/name}","releases_url":"https://api.github.com/repos/GuillaumeGomez/rust/releases{/id}","created_at":"2015-03-23T18:35:10Z","updated_at":"2015-05-05T17:42:09Z","pushed_at":"2015-10-13T13:41:27Z","git_url":"git://github.com/GuillaumeGomez/rust.git","ssh_url":"git@github.com:GuillaumeGomez/rust.git","clone_url":"https://github.com/GuillaumeGomez/rust.git","svn_url":"https://github.com/GuillaumeGomez/rust","homepage":"http://www.rust-lang.org","size":324783,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"ec4362da562a4b591a7d120c6677e14ea713481a","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","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,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","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},"private":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}","created_at":"2010-06-16T20:39:03Z","updated_at":"2015-10-13T11:40:34Z","pushed_at":"2015-10-13T13:47:14Z","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":"http://www.rust-lang.org","size":692843,"stargazers_count":13785,"watchers_count":13785,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2676,"mirror_url":null,"open_issues_count":2286,"forks":2676,"open_issues":2286,"watchers":13785,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28909"},"html":{"href":"https://github.com/rust-lang/rust/pull/28909"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/28909"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/28909/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28909/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/28909/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/881b6c1493dcd9468207c64eccbe8c050b1d6cb5"}}}}