{"action":"created","comment":{"url":"https://api.github.com/repos/japaric/rustc-builtins/pulls/comments/75602960","id":75602960,"diff_hunk":"@@ -24,6 +24,19 @@ See [rust-lang/rust#35437][0].\n [2]: https://github.com/rust-lang/compiler-rt/tree/8598065bd965d9713bfafb6c1e766d63a7b17b89/lib/builtins\n [3]: https://travis-ci.org/japaric/rustc-builtins\n \n+### Porting Reminders\n+\n+1. [Rust][4] and [C][5] have slightly different operator precedence.\n+2. C assumes wrapping operations everywhere. Rust panics on overflow when in debug mode. Consider using the [Wrapping][6] type or the explicit [wrapping_*][7] functions where applicable.\n+3. Note [C implicit casts][8], especially integer promotion. Rust is much more explicit about casting, be sure that any cast which affects the output is ported to the Rust implementation.\n+4. Rust has many functions for integer or floating point manipulation in the standard library. Consider using one of these functions rather than porting a new one. ","path":"README.md","position":9,"original_position":9,"commit_id":"64de9f8d7481417ba2dbd26c054fbff637b40f6a","original_commit_id":"64de9f8d7481417ba2dbd26c054fbff637b40f6a","user":{"login":"japaric","id":5018213,"avatar_url":"https://avatars.githubusercontent.com/u/5018213?v=3","gravatar_id":"","url":"https://api.github.com/users/japaric","html_url":"https://github.com/japaric","followers_url":"https://api.github.com/users/japaric/followers","following_url":"https://api.github.com/users/japaric/following{/other_user}","gists_url":"https://api.github.com/users/japaric/gists{/gist_id}","starred_url":"https://api.github.com/users/japaric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/japaric/subscriptions","organizations_url":"https://api.github.com/users/japaric/orgs","repos_url":"https://api.github.com/users/japaric/repos","events_url":"https://api.github.com/users/japaric/events{/privacy}","received_events_url":"https://api.github.com/users/japaric/received_events","type":"User","site_admin":false},"body":"Could you add links to the primitive doc pages like https://doc.rust-lang.org/std/primitive.i8.html ?","created_at":"2016-08-21T20:43:18Z","updated_at":"2016-08-21T20:43:18Z","html_url":"https://github.com/japaric/rustc-builtins/pull/52#discussion_r75602960","pull_request_url":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/japaric/rustc-builtins/pulls/comments/75602960"},"html":{"href":"https://github.com/japaric/rustc-builtins/pull/52#discussion_r75602960"},"pull_request":{"href":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52","id":82112967,"html_url":"https://github.com/japaric/rustc-builtins/pull/52","diff_url":"https://github.com/japaric/rustc-builtins/pull/52.diff","patch_url":"https://github.com/japaric/rustc-builtins/pull/52.patch","issue_url":"https://api.github.com/repos/japaric/rustc-builtins/issues/52","number":52,"state":"open","locked":false,"title":"Add a `Porting Reminders` section to the README","user":{"login":"mattico","id":853158,"avatar_url":"https://avatars.githubusercontent.com/u/853158?v=3","gravatar_id":"","url":"https://api.github.com/users/mattico","html_url":"https://github.com/mattico","followers_url":"https://api.github.com/users/mattico/followers","following_url":"https://api.github.com/users/mattico/following{/other_user}","gists_url":"https://api.github.com/users/mattico/gists{/gist_id}","starred_url":"https://api.github.com/users/mattico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattico/subscriptions","organizations_url":"https://api.github.com/users/mattico/orgs","repos_url":"https://api.github.com/users/mattico/repos","events_url":"https://api.github.com/users/mattico/events{/privacy}","received_events_url":"https://api.github.com/users/mattico/received_events","type":"User","site_admin":false},"body":"This is all pretty basic stuff, but it doesn't hurt to have a reminder (would've saved me some time ;) ).","created_at":"2016-08-21T18:36:42Z","updated_at":"2016-08-21T20:43:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c21fb09c4514d2f64be16270fa9d95e079339858","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52/commits","review_comments_url":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52/comments","review_comment_url":"https://api.github.com/repos/japaric/rustc-builtins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/japaric/rustc-builtins/issues/52/comments","statuses_url":"https://api.github.com/repos/japaric/rustc-builtins/statuses/64de9f8d7481417ba2dbd26c054fbff637b40f6a","head":{"label":"mattico:add-readme-port-help","ref":"add-readme-port-help","sha":"64de9f8d7481417ba2dbd26c054fbff637b40f6a","user":{"login":"mattico","id":853158,"avatar_url":"https://avatars.githubusercontent.com/u/853158?v=3","gravatar_id":"","url":"https://api.github.com/users/mattico","html_url":"https://github.com/mattico","followers_url":"https://api.github.com/users/mattico/followers","following_url":"https://api.github.com/users/mattico/following{/other_user}","gists_url":"https://api.github.com/users/mattico/gists{/gist_id}","starred_url":"https://api.github.com/users/mattico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattico/subscriptions","organizations_url":"https://api.github.com/users/mattico/orgs","repos_url":"https://api.github.com/users/mattico/repos","events_url":"https://api.github.com/users/mattico/events{/privacy}","received_events_url":"https://api.github.com/users/mattico/received_events","type":"User","site_admin":false},"repo":{"id":65842253,"name":"rustc-builtins","full_name":"mattico/rustc-builtins","owner":{"login":"mattico","id":853158,"avatar_url":"https://avatars.githubusercontent.com/u/853158?v=3","gravatar_id":"","url":"https://api.github.com/users/mattico","html_url":"https://github.com/mattico","followers_url":"https://api.github.com/users/mattico/followers","following_url":"https://api.github.com/users/mattico/following{/other_user}","gists_url":"https://api.github.com/users/mattico/gists{/gist_id}","starred_url":"https://api.github.com/users/mattico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattico/subscriptions","organizations_url":"https://api.github.com/users/mattico/orgs","repos_url":"https://api.github.com/users/mattico/repos","events_url":"https://api.github.com/users/mattico/events{/privacy}","received_events_url":"https://api.github.com/users/mattico/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattico/rustc-builtins","description":"[WIP] Porting `compiler-rt` intrinsics to Rust","fork":true,"url":"https://api.github.com/repos/mattico/rustc-builtins","forks_url":"https://api.github.com/repos/mattico/rustc-builtins/forks","keys_url":"https://api.github.com/repos/mattico/rustc-builtins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattico/rustc-builtins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattico/rustc-builtins/teams","hooks_url":"https://api.github.com/repos/mattico/rustc-builtins/hooks","issue_events_url":"https://api.github.com/repos/mattico/rustc-builtins/issues/events{/number}","events_url":"https://api.github.com/repos/mattico/rustc-builtins/events","assignees_url":"https://api.github.com/repos/mattico/rustc-builtins/assignees{/user}","branches_url":"https://api.github.com/repos/mattico/rustc-builtins/branches{/branch}","tags_url":"https://api.github.com/repos/mattico/rustc-builtins/tags","blobs_url":"https://api.github.com/repos/mattico/rustc-builtins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattico/rustc-builtins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattico/rustc-builtins/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattico/rustc-builtins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattico/rustc-builtins/statuses/{sha}","languages_url":"https://api.github.com/repos/mattico/rustc-builtins/languages","stargazers_url":"https://api.github.com/repos/mattico/rustc-builtins/stargazers","contributors_url":"https://api.github.com/repos/mattico/rustc-builtins/contributors","subscribers_url":"https://api.github.com/repos/mattico/rustc-builtins/subscribers","subscription_url":"https://api.github.com/repos/mattico/rustc-builtins/subscription","commits_url":"https://api.github.com/repos/mattico/rustc-builtins/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattico/rustc-builtins/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattico/rustc-builtins/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattico/rustc-builtins/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattico/rustc-builtins/contents/{+path}","compare_url":"https://api.github.com/repos/mattico/rustc-builtins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattico/rustc-builtins/merges","archive_url":"https://api.github.com/repos/mattico/rustc-builtins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattico/rustc-builtins/downloads","issues_url":"https://api.github.com/repos/mattico/rustc-builtins/issues{/number}","pulls_url":"https://api.github.com/repos/mattico/rustc-builtins/pulls{/number}","milestones_url":"https://api.github.com/repos/mattico/rustc-builtins/milestones{/number}","notifications_url":"https://api.github.com/repos/mattico/rustc-builtins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattico/rustc-builtins/labels{/name}","releases_url":"https://api.github.com/repos/mattico/rustc-builtins/releases{/id}","deployments_url":"https://api.github.com/repos/mattico/rustc-builtins/deployments","created_at":"2016-08-16T18:02:23Z","updated_at":"2016-08-16T18:02:24Z","pushed_at":"2016-08-21T19:59:41Z","git_url":"git://github.com/mattico/rustc-builtins.git","ssh_url":"git@github.com:mattico/rustc-builtins.git","clone_url":"https://github.com/mattico/rustc-builtins.git","svn_url":"https://github.com/mattico/rustc-builtins","homepage":"https://github.com/rust-lang/rust/issues/35437","size":106,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"japaric:master","ref":"master","sha":"7811f92bea72a3c05b024b1748574544f0fd3c79","user":{"login":"japaric","id":5018213,"avatar_url":"https://avatars.githubusercontent.com/u/5018213?v=3","gravatar_id":"","url":"https://api.github.com/users/japaric","html_url":"https://github.com/japaric","followers_url":"https://api.github.com/users/japaric/followers","following_url":"https://api.github.com/users/japaric/following{/other_user}","gists_url":"https://api.github.com/users/japaric/gists{/gist_id}","starred_url":"https://api.github.com/users/japaric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/japaric/subscriptions","organizations_url":"https://api.github.com/users/japaric/orgs","repos_url":"https://api.github.com/users/japaric/repos","events_url":"https://api.github.com/users/japaric/events{/privacy}","received_events_url":"https://api.github.com/users/japaric/received_events","type":"User","site_admin":false},"repo":{"id":65153793,"name":"rustc-builtins","full_name":"japaric/rustc-builtins","owner":{"login":"japaric","id":5018213,"avatar_url":"https://avatars.githubusercontent.com/u/5018213?v=3","gravatar_id":"","url":"https://api.github.com/users/japaric","html_url":"https://github.com/japaric","followers_url":"https://api.github.com/users/japaric/followers","following_url":"https://api.github.com/users/japaric/following{/other_user}","gists_url":"https://api.github.com/users/japaric/gists{/gist_id}","starred_url":"https://api.github.com/users/japaric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/japaric/subscriptions","organizations_url":"https://api.github.com/users/japaric/orgs","repos_url":"https://api.github.com/users/japaric/repos","events_url":"https://api.github.com/users/japaric/events{/privacy}","received_events_url":"https://api.github.com/users/japaric/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/japaric/rustc-builtins","description":"[WIP] Porting `compiler-rt` intrinsics to Rust","fork":false,"url":"https://api.github.com/repos/japaric/rustc-builtins","forks_url":"https://api.github.com/repos/japaric/rustc-builtins/forks","keys_url":"https://api.github.com/repos/japaric/rustc-builtins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/japaric/rustc-builtins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/japaric/rustc-builtins/teams","hooks_url":"https://api.github.com/repos/japaric/rustc-builtins/hooks","issue_events_url":"https://api.github.com/repos/japaric/rustc-builtins/issues/events{/number}","events_url":"https://api.github.com/repos/japaric/rustc-builtins/events","assignees_url":"https://api.github.com/repos/japaric/rustc-builtins/assignees{/user}","branches_url":"https://api.github.com/repos/japaric/rustc-builtins/branches{/branch}","tags_url":"https://api.github.com/repos/japaric/rustc-builtins/tags","blobs_url":"https://api.github.com/repos/japaric/rustc-builtins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/japaric/rustc-builtins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/japaric/rustc-builtins/git/refs{/sha}","trees_url":"https://api.github.com/repos/japaric/rustc-builtins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/japaric/rustc-builtins/statuses/{sha}","languages_url":"https://api.github.com/repos/japaric/rustc-builtins/languages","stargazers_url":"https://api.github.com/repos/japaric/rustc-builtins/stargazers","contributors_url":"https://api.github.com/repos/japaric/rustc-builtins/contributors","subscribers_url":"https://api.github.com/repos/japaric/rustc-builtins/subscribers","subscription_url":"https://api.github.com/repos/japaric/rustc-builtins/subscription","commits_url":"https://api.github.com/repos/japaric/rustc-builtins/commits{/sha}","git_commits_url":"https://api.github.com/repos/japaric/rustc-builtins/git/commits{/sha}","comments_url":"https://api.github.com/repos/japaric/rustc-builtins/comments{/number}","issue_comment_url":"https://api.github.com/repos/japaric/rustc-builtins/issues/comments{/number}","contents_url":"https://api.github.com/repos/japaric/rustc-builtins/contents/{+path}","compare_url":"https://api.github.com/repos/japaric/rustc-builtins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/japaric/rustc-builtins/merges","archive_url":"https://api.github.com/repos/japaric/rustc-builtins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/japaric/rustc-builtins/downloads","issues_url":"https://api.github.com/repos/japaric/rustc-builtins/issues{/number}","pulls_url":"https://api.github.com/repos/japaric/rustc-builtins/pulls{/number}","milestones_url":"https://api.github.com/repos/japaric/rustc-builtins/milestones{/number}","notifications_url":"https://api.github.com/repos/japaric/rustc-builtins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/japaric/rustc-builtins/labels{/name}","releases_url":"https://api.github.com/repos/japaric/rustc-builtins/releases{/id}","deployments_url":"https://api.github.com/repos/japaric/rustc-builtins/deployments","created_at":"2016-08-07T20:58:44Z","updated_at":"2016-08-18T20:29:55Z","pushed_at":"2016-08-21T19:36:42Z","git_url":"git://github.com/japaric/rustc-builtins.git","ssh_url":"git@github.com:japaric/rustc-builtins.git","clone_url":"https://github.com/japaric/rustc-builtins.git","svn_url":"https://github.com/japaric/rustc-builtins","homepage":"https://github.com/rust-lang/rust/issues/35437","size":108,"stargazers_count":7,"watchers_count":7,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52"},"html":{"href":"https://github.com/japaric/rustc-builtins/pull/52"},"issue":{"href":"https://api.github.com/repos/japaric/rustc-builtins/issues/52"},"comments":{"href":"https://api.github.com/repos/japaric/rustc-builtins/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/japaric/rustc-builtins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/japaric/rustc-builtins/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/japaric/rustc-builtins/statuses/64de9f8d7481417ba2dbd26c054fbff637b40f6a"}}}}
{"actor":{"display_login":"japaric"}}