{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/50293024","id":50293024,"diff_hunk":"@@ -344,11 +344,18 @@ impl LateLintPass for TypeLimits {\n             }\n         }\n \n-        fn forbid_unsigned_negation(cx: &LateContext, span: Span) {\n-            cx.sess()\n-              .struct_span_err_with_code(span, \"unary negation of unsigned integer\", \"E0519\")\n-              .span_help(span, \"use a cast or the `!` operator\")\n-              .emit();\n+        fn forbid_unsigned_negation(cx: &LateContext, span: Span, lit_span: Span) {\n+            let mut err = cx.sess()\n+                            .struct_span_err_with_code(span,\n+                                                       \"unary negation of unsigned integer\",\n+                                                       \"E0519\");\n+              if let Ok(snip) = cx.sess().codemap().span_to_snippet(lit_span) {\n+                err.span_suggestion(span, \"try using a cast or the `!` operator:\",\n+                                    format!(\"!{}\", snip));","path":"src/librustc_lint/types.rs","position":39,"original_position":39,"commit_id":"4a9a568558554e978bb4bac9351d15eae0d69d74","original_commit_id":"4a9a568558554e978bb4bac9351d15eae0d69d74","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"body":"Huh. Adding a generic cast here is harder so I'll just fix up the help message.","created_at":"2016-01-20T18:03:50Z","updated_at":"2016-01-20T18:03:50Z","html_url":"https://github.com/rust-lang/rust/pull/31053#discussion_r50293024","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/31053","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/50293024"},"html":{"href":"https://github.com/rust-lang/rust/pull/31053#discussion_r50293024"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/31053"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/31053","id":56633845,"html_url":"https://github.com/rust-lang/rust/pull/31053","diff_url":"https://github.com/rust-lang/rust/pull/31053.diff","patch_url":"https://github.com/rust-lang/rust/pull/31053.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/31053","number":31053,"state":"open","locked":false,"title":"Change some helps to suggestions","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"body":"r? @eddyb","created_at":"2016-01-20T16:44:28Z","updated_at":"2016-01-20T18:03:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"878f284ef4e841b3f82321cbf1bd918968595025","assignee":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/31053/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/31053/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/31053/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/4a9a568558554e978bb4bac9351d15eae0d69d74","head":{"label":"Manishearth:help_suggestions","ref":"help_suggestions","sha":"4a9a568558554e978bb4bac9351d15eae0d69d74","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"repo":{"id":18477516,"name":"rust","full_name":"Manishearth/rust","owner":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Manishearth/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/Manishearth/rust","forks_url":"https://api.github.com/repos/Manishearth/rust/forks","keys_url":"https://api.github.com/repos/Manishearth/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Manishearth/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Manishearth/rust/teams","hooks_url":"https://api.github.com/repos/Manishearth/rust/hooks","issue_events_url":"https://api.github.com/repos/Manishearth/rust/issues/events{/number}","events_url":"https://api.github.com/repos/Manishearth/rust/events","assignees_url":"https://api.github.com/repos/Manishearth/rust/assignees{/user}","branches_url":"https://api.github.com/repos/Manishearth/rust/branches{/branch}","tags_url":"https://api.github.com/repos/Manishearth/rust/tags","blobs_url":"https://api.github.com/repos/Manishearth/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Manishearth/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Manishearth/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/Manishearth/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Manishearth/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/Manishearth/rust/languages","stargazers_url":"https://api.github.com/repos/Manishearth/rust/stargazers","contributors_url":"https://api.github.com/repos/Manishearth/rust/contributors","subscribers_url":"https://api.github.com/repos/Manishearth/rust/subscribers","subscription_url":"https://api.github.com/repos/Manishearth/rust/subscription","commits_url":"https://api.github.com/repos/Manishearth/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/Manishearth/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/Manishearth/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/Manishearth/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/Manishearth/rust/contents/{+path}","compare_url":"https://api.github.com/repos/Manishearth/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Manishearth/rust/merges","archive_url":"https://api.github.com/repos/Manishearth/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Manishearth/rust/downloads","issues_url":"https://api.github.com/repos/Manishearth/rust/issues{/number}","pulls_url":"https://api.github.com/repos/Manishearth/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/Manishearth/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/Manishearth/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Manishearth/rust/labels{/name}","releases_url":"https://api.github.com/repos/Manishearth/rust/releases{/id}","created_at":"2014-04-05T21:54:27Z","updated_at":"2015-02-23T09:02:42Z","pushed_at":"2016-01-20T17:30:23Z","git_url":"git://github.com/Manishearth/rust.git","ssh_url":"git@github.com:Manishearth/rust.git","clone_url":"https://github.com/Manishearth/rust.git","svn_url":"https://github.com/Manishearth/rust","homepage":"http://www.rust-lang.org","size":273930,"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":"rust-lang:master","ref":"master","sha":"c4c9628de7d4e970b2cb43d0f1a4c8f9ad03aca1","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":"2016-01-20T17:12:17Z","pushed_at":"2016-01-20T17:44:59Z","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":465774,"stargazers_count":14983,"watchers_count":14983,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2924,"mirror_url":null,"open_issues_count":2351,"forks":2924,"open_issues":2351,"watchers":14983,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/31053"},"html":{"href":"https://github.com/rust-lang/rust/pull/31053"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/31053"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/31053/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/31053/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/31053/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/4a9a568558554e978bb4bac9351d15eae0d69d74"}}}}