{"action":"created","comment":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments/54613431","id":54613431,"diff_hunk":"@@ -673,3 +673,19 @@ pub fn camel_case_from(s: &str) -> usize {\n     }\n     last_i\n }\n+\n+/// Return whether a method returns `Self`.\n+pub fn returns_self(cx: &LateContext, ret: &FunctionRetTy, ty: ty::Ty) -> bool {\n+    if let FunctionRetTy::Return(ref ret_ty) = *ret {\n+        let ast_ty_to_ty_cache = cx.tcx.ast_ty_to_ty_cache.borrow();","path":"src/utils/mod.rs","position":26,"original_position":26,"commit_id":"ddb8cb74e50420e9ad92ee71c1cdd3cd166cd991","original_commit_id":"ddb8cb74e50420e9ad92ee71c1cdd3cd166cd991","user":{"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},"body":"You should get the return type from the function type and not look at the function's AST/HIR at all.","created_at":"2016-03-01T18:42:20Z","updated_at":"2016-03-01T18:42:20Z","html_url":"https://github.com/Manishearth/rust-clippy/pull/730#discussion_r54613431","pull_request_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730","_links":{"self":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments/54613431"},"html":{"href":"https://github.com/Manishearth/rust-clippy/pull/730#discussion_r54613431"},"pull_request":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730"}}},"pull_request":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730","id":61258549,"html_url":"https://github.com/Manishearth/rust-clippy/pull/730","diff_url":"https://github.com/Manishearth/rust-clippy/pull/730.diff","patch_url":"https://github.com/Manishearth/rust-clippy/pull/730.patch","issue_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/730","number":730,"state":"open","locked":false,"title":"Lint unused labels and types with `fn new() -> Self` and no `Default` impl","user":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"body":"Fix  #705. Fix #708.","created_at":"2016-03-01T15:28:11Z","updated_at":"2016-03-01T18:42:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f11726f52b3b66bee9254e966127c72d5e8a05d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730/commits","review_comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730/comments","review_comment_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/730/comments","statuses_url":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/ddb8cb74e50420e9ad92ee71c1cdd3cd166cd991","head":{"label":"mcarton:unused-labels","ref":"unused-labels","sha":"ddb8cb74e50420e9ad92ee71c1cdd3cd166cd991","user":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"repo":{"id":48387599,"name":"rust-clippy","full_name":"mcarton/rust-clippy","owner":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mcarton/rust-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":true,"url":"https://api.github.com/repos/mcarton/rust-clippy","forks_url":"https://api.github.com/repos/mcarton/rust-clippy/forks","keys_url":"https://api.github.com/repos/mcarton/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mcarton/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mcarton/rust-clippy/teams","hooks_url":"https://api.github.com/repos/mcarton/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/mcarton/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/mcarton/rust-clippy/events","assignees_url":"https://api.github.com/repos/mcarton/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/mcarton/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/mcarton/rust-clippy/tags","blobs_url":"https://api.github.com/repos/mcarton/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mcarton/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mcarton/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mcarton/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mcarton/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/mcarton/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/mcarton/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/mcarton/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/mcarton/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/mcarton/rust-clippy/subscription","commits_url":"https://api.github.com/repos/mcarton/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mcarton/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mcarton/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mcarton/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mcarton/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/mcarton/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mcarton/rust-clippy/merges","archive_url":"https://api.github.com/repos/mcarton/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mcarton/rust-clippy/downloads","issues_url":"https://api.github.com/repos/mcarton/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/mcarton/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/mcarton/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/mcarton/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mcarton/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/mcarton/rust-clippy/releases{/id}","deployments_url":"https://api.github.com/repos/mcarton/rust-clippy/deployments","created_at":"2015-12-21T18:31:02Z","updated_at":"2016-01-19T11:06:09Z","pushed_at":"2016-03-01T16:23:54Z","git_url":"git://github.com/mcarton/rust-clippy.git","ssh_url":"git@github.com:mcarton/rust-clippy.git","clone_url":"https://github.com/mcarton/rust-clippy.git","svn_url":"https://github.com/mcarton/rust-clippy","homepage":"","size":1779,"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":"Manishearth:master","ref":"master","sha":"e4b3cbb09133ff4fbc1afb992565587035b78cb4","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":26850443,"name":"rust-clippy","full_name":"Manishearth/rust-clippy","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-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":false,"url":"https://api.github.com/repos/Manishearth/rust-clippy","forks_url":"https://api.github.com/repos/Manishearth/rust-clippy/forks","keys_url":"https://api.github.com/repos/Manishearth/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Manishearth/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Manishearth/rust-clippy/teams","hooks_url":"https://api.github.com/repos/Manishearth/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/events","assignees_url":"https://api.github.com/repos/Manishearth/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/Manishearth/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/Manishearth/rust-clippy/tags","blobs_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/Manishearth/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/Manishearth/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/Manishearth/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/Manishearth/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/Manishearth/rust-clippy/subscription","commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Manishearth/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/Manishearth/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Manishearth/rust-clippy/merges","archive_url":"https://api.github.com/repos/Manishearth/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Manishearth/rust-clippy/downloads","issues_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/Manishearth/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/Manishearth/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/Manishearth/rust-clippy/releases{/id}","deployments_url":"https://api.github.com/repos/Manishearth/rust-clippy/deployments","created_at":"2014-11-19T07:49:21Z","updated_at":"2016-03-01T17:49:38Z","pushed_at":"2016-03-01T16:23:55Z","git_url":"git://github.com/Manishearth/rust-clippy.git","ssh_url":"git@github.com:Manishearth/rust-clippy.git","clone_url":"https://github.com/Manishearth/rust-clippy.git","svn_url":"https://github.com/Manishearth/rust-clippy","homepage":"","size":1876,"stargazers_count":473,"watchers_count":473,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":145,"forks":55,"open_issues":145,"watchers":473,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730"},"html":{"href":"https://github.com/Manishearth/rust-clippy/pull/730"},"issue":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/issues/730"},"comments":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/issues/730/comments"},"review_comments":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730/comments"},"review_comment":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/730/commits"},"statuses":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/ddb8cb74e50420e9ad92ee71c1cdd3cd166cd991"}}}}