{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/35153913","id":35153913,"diff_hunk":"@@ -398,43 +396,256 @@ struct ImproperCTypesVisitor<'a, 'tcx: 'a> {\n     cx: &'a Context<'a, 'tcx>\n }\n \n+enum FfiResult {\n+    FfiSafe,\n+    FfiUnsafe(&'static str),\n+    FfiBadStruct(ast::DefId, &'static str),\n+    FfiBadEnum(ast::DefId, &'static str)\n+}\n+\n+/// Check if this enum can be safely exported based on the\n+/// \"nullable pointer optimization\". Currently restricted\n+/// to function pointers and references, but could be\n+/// expanded to cover NonZero raw pointers and newtypes.\n+fn is_repr_nullable_ptr<'tcx>(variants: &Vec<Rc<ty::VariantInfo<'tcx>>>) -> bool {","path":"src/librustc_lint/builtin.rs","position":41,"original_position":41,"commit_id":"09cfcba2bff30e063ad108c0a202bad01053275c","original_commit_id":"09cfcba2bff30e063ad108c0a202bad01053275c","user":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"body":"Can we share this code with trans? I'm pretty uncomfortable with having two different ways of answering this question.","created_at":"2015-07-21T21:00:54Z","updated_at":"2015-07-21T21:00:54Z","html_url":"https://github.com/rust-lang/rust/pull/26583#discussion_r35153913","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/26583","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/35153913"},"html":{"href":"https://github.com/rust-lang/rust/pull/26583#discussion_r35153913"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/26583"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/26583","id":38609913,"html_url":"https://github.com/rust-lang/rust/pull/26583","diff_url":"https://github.com/rust-lang/rust/pull/26583.diff","patch_url":"https://github.com/rust-lang/rust/pull/26583.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/26583","number":26583,"state":"open","locked":false,"title":"Rewrite the improper_ctypes lint.","user":{"login":"eefriedman","id":12769964,"avatar_url":"https://avatars.githubusercontent.com/u/12769964?v=3","gravatar_id":"","url":"https://api.github.com/users/eefriedman","html_url":"https://github.com/eefriedman","followers_url":"https://api.github.com/users/eefriedman/followers","following_url":"https://api.github.com/users/eefriedman/following{/other_user}","gists_url":"https://api.github.com/users/eefriedman/gists{/gist_id}","starred_url":"https://api.github.com/users/eefriedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eefriedman/subscriptions","organizations_url":"https://api.github.com/users/eefriedman/orgs","repos_url":"https://api.github.com/users/eefriedman/repos","events_url":"https://api.github.com/users/eefriedman/events{/privacy}","received_events_url":"https://api.github.com/users/eefriedman/received_events","type":"User","site_admin":false},"body":"Makes the lint a bit more accurate, and improves the quality of the diagnostic\r\nmessages by explicitly returning an error message.","created_at":"2015-06-26T01:24:04Z","updated_at":"2015-07-21T21:00:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"049693fb6a565872664d4b017f232a9427d39c93","assignee":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/26583/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/26583/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/26583/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/09cfcba2bff30e063ad108c0a202bad01053275c","head":{"label":"eefriedman:lint-ffi","ref":"lint-ffi","sha":"09cfcba2bff30e063ad108c0a202bad01053275c","user":{"login":"eefriedman","id":12769964,"avatar_url":"https://avatars.githubusercontent.com/u/12769964?v=3","gravatar_id":"","url":"https://api.github.com/users/eefriedman","html_url":"https://github.com/eefriedman","followers_url":"https://api.github.com/users/eefriedman/followers","following_url":"https://api.github.com/users/eefriedman/following{/other_user}","gists_url":"https://api.github.com/users/eefriedman/gists{/gist_id}","starred_url":"https://api.github.com/users/eefriedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eefriedman/subscriptions","organizations_url":"https://api.github.com/users/eefriedman/orgs","repos_url":"https://api.github.com/users/eefriedman/repos","events_url":"https://api.github.com/users/eefriedman/events{/privacy}","received_events_url":"https://api.github.com/users/eefriedman/received_events","type":"User","site_admin":false},"repo":{"id":36962943,"name":"rust","full_name":"eefriedman/rust","owner":{"login":"eefriedman","id":12769964,"avatar_url":"https://avatars.githubusercontent.com/u/12769964?v=3","gravatar_id":"","url":"https://api.github.com/users/eefriedman","html_url":"https://github.com/eefriedman","followers_url":"https://api.github.com/users/eefriedman/followers","following_url":"https://api.github.com/users/eefriedman/following{/other_user}","gists_url":"https://api.github.com/users/eefriedman/gists{/gist_id}","starred_url":"https://api.github.com/users/eefriedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eefriedman/subscriptions","organizations_url":"https://api.github.com/users/eefriedman/orgs","repos_url":"https://api.github.com/users/eefriedman/repos","events_url":"https://api.github.com/users/eefriedman/events{/privacy}","received_events_url":"https://api.github.com/users/eefriedman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eefriedman/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/eefriedman/rust","forks_url":"https://api.github.com/repos/eefriedman/rust/forks","keys_url":"https://api.github.com/repos/eefriedman/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eefriedman/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eefriedman/rust/teams","hooks_url":"https://api.github.com/repos/eefriedman/rust/hooks","issue_events_url":"https://api.github.com/repos/eefriedman/rust/issues/events{/number}","events_url":"https://api.github.com/repos/eefriedman/rust/events","assignees_url":"https://api.github.com/repos/eefriedman/rust/assignees{/user}","branches_url":"https://api.github.com/repos/eefriedman/rust/branches{/branch}","tags_url":"https://api.github.com/repos/eefriedman/rust/tags","blobs_url":"https://api.github.com/repos/eefriedman/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eefriedman/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eefriedman/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/eefriedman/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eefriedman/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/eefriedman/rust/languages","stargazers_url":"https://api.github.com/repos/eefriedman/rust/stargazers","contributors_url":"https://api.github.com/repos/eefriedman/rust/contributors","subscribers_url":"https://api.github.com/repos/eefriedman/rust/subscribers","subscription_url":"https://api.github.com/repos/eefriedman/rust/subscription","commits_url":"https://api.github.com/repos/eefriedman/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/eefriedman/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/eefriedman/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/eefriedman/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/eefriedman/rust/contents/{+path}","compare_url":"https://api.github.com/repos/eefriedman/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eefriedman/rust/merges","archive_url":"https://api.github.com/repos/eefriedman/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eefriedman/rust/downloads","issues_url":"https://api.github.com/repos/eefriedman/rust/issues{/number}","pulls_url":"https://api.github.com/repos/eefriedman/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/eefriedman/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/eefriedman/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eefriedman/rust/labels{/name}","releases_url":"https://api.github.com/repos/eefriedman/rust/releases{/id}","created_at":"2015-06-06T01:21:36Z","updated_at":"2015-06-06T01:22:02Z","pushed_at":"2015-07-18T21:06:34Z","git_url":"git://github.com/eefriedman/rust.git","ssh_url":"git@github.com:eefriedman/rust.git","clone_url":"https://github.com/eefriedman/rust.git","svn_url":"https://github.com/eefriedman/rust","homepage":"http://www.rust-lang.org","size":305903,"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":"42e545ffa73836525d10e1c658b622ddb12b7f93","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-07-21T12:40:12Z","pushed_at":"2015-07-21T20:59:48Z","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":647430,"stargazers_count":12681,"watchers_count":12681,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2441,"mirror_url":null,"open_issues_count":2165,"forks":2441,"open_issues":2165,"watchers":12681,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/26583"},"html":{"href":"https://github.com/rust-lang/rust/pull/26583"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/26583"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/26583/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/26583/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/26583/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/09cfcba2bff30e063ad108c0a202bad01053275c"}}}}