{"action":"created","comment":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments/85652228","pull_request_review_id":6357533,"id":85652228,"diff_hunk":"@@ -0,0 +1,55 @@\n+use rustc::lint::*;\n+use rustc::hir::*;\n+use utils::{is_automatically_derived, span_lint};\n+\n+/// **What it does:** Checks for manual re-implementations of `PartialEq::ne`.\n+///\n+/// **Why is this bad?** `PartialEq::ne` is required to always return the\n+/// negated result of `PartialEq::eq`, which is exactly what the default\n+/// implementation does. Therefore, there should never be any need to\n+/// re-implement it.\n+///\n+/// **Known problems:** None.\n+///\n+/// **Example:**\n+/// ```rust\n+/// struct Foo;\n+///\n+/// impl PartialEq for Foo {\n+///    fn eq(&self, other: &Foo) -> bool { ... }\n+///    fn ne(&self, other: &Foo) -> bool { !(self == other) }\n+/// }\n+/// ```\n+declare_lint! {\n+    pub PARTIALEQ_NE_IMPL,\n+    Warn,\n+    \"re-implementing PartialEq::ne\"\n+}\n+\n+#[derive(Clone, Copy)]\n+pub struct Pass;\n+\n+impl LintPass for Pass {\n+    fn get_lints(&self) -> LintArray {\n+        lint_array!(PARTIALEQ_NE_IMPL)\n+    }\n+}\n+\n+impl LateLintPass for Pass {\n+    fn check_item(&mut self, cx: &LateContext, item: &Item) {\n+        if_let_chain! {[\n+            let ItemImpl(_, _, _, Some(ref trait_ref), _, ref impl_items) = item.node,\n+            !is_automatically_derived(&*item.attrs),\n+            cx.tcx.expect_def(trait_ref.ref_id).def_id() == cx.tcx.lang_items.eq_trait().unwrap(),\n+        ], {\n+            for impl_item in impl_items {\n+                if &*impl_item.name.as_str() == \"ne\" {\n+                    span_lint(cx,\n+                              PARTIALEQ_NE_IMPL,\n+                              impl_item.span,\n+                              \"Re-implementing `PartialEq::ne`\")\n+                }","path":"clippy_lints/src/partialeq_ne_impl.rs","position":51,"original_position":51,"commit_id":"ea977a9a85d8a7587aebcb0d5436a6b950071886","original_commit_id":"ea977a9a85d8a7587aebcb0d5436a6b950071886","user":{"login":"oli-obk","id":332036,"avatar_url":"https://avatars.githubusercontent.com/u/332036?v=3","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"body":"This should also give a help message telling the user what to do( remove the impl)","created_at":"2016-10-30T03:06:31Z","updated_at":"2016-10-30T03:06:31Z","html_url":"https://github.com/Manishearth/rust-clippy/pull/1307#discussion_r85652228","pull_request_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307","_links":{"self":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/comments/85652228"},"html":{"href":"https://github.com/Manishearth/rust-clippy/pull/1307#discussion_r85652228"},"pull_request":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307"}}},"pull_request":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307","id":91508265,"html_url":"https://github.com/Manishearth/rust-clippy/pull/1307","diff_url":"https://github.com/Manishearth/rust-clippy/pull/1307.diff","patch_url":"https://github.com/Manishearth/rust-clippy/pull/1307.patch","issue_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1307","number":1307,"state":"open","locked":false,"title":"Implement 'Re-implementing `PartialEq::ne`' lint","user":{"login":"Kha","id":109126,"avatar_url":"https://avatars.githubusercontent.com/u/109126?v=3","gravatar_id":"","url":"https://api.github.com/users/Kha","html_url":"https://github.com/Kha","followers_url":"https://api.github.com/users/Kha/followers","following_url":"https://api.github.com/users/Kha/following{/other_user}","gists_url":"https://api.github.com/users/Kha/gists{/gist_id}","starred_url":"https://api.github.com/users/Kha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kha/subscriptions","organizations_url":"https://api.github.com/users/Kha/orgs","repos_url":"https://api.github.com/users/Kha/repos","events_url":"https://api.github.com/users/Kha/events{/privacy}","received_events_url":"https://api.github.com/users/Kha/received_events","type":"User","site_admin":false},"body":"Closes #86\r\n\r\n@oli-obk I didn't track the time for implementing this, but most of it was probably spent on figuring out why `compiletest` kept saying `0 unexpected errors found, 1 expected errors not found`. In the end, I copied and ran the `rustc` cmdline for that file separately, which showed that there was indeed an unexpected and very simple error: `main function not found` :| . Apparently `compiletest` [may swallow unexpected errors](https://github.com/laumann/compiletest-rs/issues/48).\r\n\r\nSo perhaps `CONTRIBUTING.md` should include some hints for debugging lints, including mentioning the `TESTNAME` env var and `#[clippy_dump]`.","created_at":"2016-10-30T01:57:57Z","updated_at":"2016-10-30T03:13:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00621d648382c998181862cc227b51fcf41a3641","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307/commits","review_comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307/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/1307/comments","statuses_url":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/ea977a9a85d8a7587aebcb0d5436a6b950071886","head":{"label":"Kha:partialeq_ne","ref":"partialeq_ne","sha":"ea977a9a85d8a7587aebcb0d5436a6b950071886","user":{"login":"Kha","id":109126,"avatar_url":"https://avatars.githubusercontent.com/u/109126?v=3","gravatar_id":"","url":"https://api.github.com/users/Kha","html_url":"https://github.com/Kha","followers_url":"https://api.github.com/users/Kha/followers","following_url":"https://api.github.com/users/Kha/following{/other_user}","gists_url":"https://api.github.com/users/Kha/gists{/gist_id}","starred_url":"https://api.github.com/users/Kha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kha/subscriptions","organizations_url":"https://api.github.com/users/Kha/orgs","repos_url":"https://api.github.com/users/Kha/repos","events_url":"https://api.github.com/users/Kha/events{/privacy}","received_events_url":"https://api.github.com/users/Kha/received_events","type":"User","site_admin":false},"repo":{"id":72318735,"name":"rust-clippy","full_name":"Kha/rust-clippy","owner":{"login":"Kha","id":109126,"avatar_url":"https://avatars.githubusercontent.com/u/109126?v=3","gravatar_id":"","url":"https://api.github.com/users/Kha","html_url":"https://github.com/Kha","followers_url":"https://api.github.com/users/Kha/followers","following_url":"https://api.github.com/users/Kha/following{/other_user}","gists_url":"https://api.github.com/users/Kha/gists{/gist_id}","starred_url":"https://api.github.com/users/Kha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kha/subscriptions","organizations_url":"https://api.github.com/users/Kha/orgs","repos_url":"https://api.github.com/users/Kha/repos","events_url":"https://api.github.com/users/Kha/events{/privacy}","received_events_url":"https://api.github.com/users/Kha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kha/rust-clippy","description":"A bunch of lints to catch common mistakes and improve your Rust code","fork":true,"url":"https://api.github.com/repos/Kha/rust-clippy","forks_url":"https://api.github.com/repos/Kha/rust-clippy/forks","keys_url":"https://api.github.com/repos/Kha/rust-clippy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kha/rust-clippy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kha/rust-clippy/teams","hooks_url":"https://api.github.com/repos/Kha/rust-clippy/hooks","issue_events_url":"https://api.github.com/repos/Kha/rust-clippy/issues/events{/number}","events_url":"https://api.github.com/repos/Kha/rust-clippy/events","assignees_url":"https://api.github.com/repos/Kha/rust-clippy/assignees{/user}","branches_url":"https://api.github.com/repos/Kha/rust-clippy/branches{/branch}","tags_url":"https://api.github.com/repos/Kha/rust-clippy/tags","blobs_url":"https://api.github.com/repos/Kha/rust-clippy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kha/rust-clippy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kha/rust-clippy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kha/rust-clippy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kha/rust-clippy/statuses/{sha}","languages_url":"https://api.github.com/repos/Kha/rust-clippy/languages","stargazers_url":"https://api.github.com/repos/Kha/rust-clippy/stargazers","contributors_url":"https://api.github.com/repos/Kha/rust-clippy/contributors","subscribers_url":"https://api.github.com/repos/Kha/rust-clippy/subscribers","subscription_url":"https://api.github.com/repos/Kha/rust-clippy/subscription","commits_url":"https://api.github.com/repos/Kha/rust-clippy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kha/rust-clippy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kha/rust-clippy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kha/rust-clippy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kha/rust-clippy/contents/{+path}","compare_url":"https://api.github.com/repos/Kha/rust-clippy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kha/rust-clippy/merges","archive_url":"https://api.github.com/repos/Kha/rust-clippy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kha/rust-clippy/downloads","issues_url":"https://api.github.com/repos/Kha/rust-clippy/issues{/number}","pulls_url":"https://api.github.com/repos/Kha/rust-clippy/pulls{/number}","milestones_url":"https://api.github.com/repos/Kha/rust-clippy/milestones{/number}","notifications_url":"https://api.github.com/repos/Kha/rust-clippy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kha/rust-clippy/labels{/name}","releases_url":"https://api.github.com/repos/Kha/rust-clippy/releases{/id}","deployments_url":"https://api.github.com/repos/Kha/rust-clippy/deployments","created_at":"2016-10-30T01:35:18Z","updated_at":"2016-10-30T01:35:20Z","pushed_at":"2016-10-30T01:36:14Z","git_url":"git://github.com/Kha/rust-clippy.git","ssh_url":"git@github.com:Kha/rust-clippy.git","clone_url":"https://github.com/Kha/rust-clippy.git","svn_url":"https://github.com/Kha/rust-clippy","homepage":"","size":3477,"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":"502416fa78fdb47e98e9983da5a101de49454b0a","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-10-30T00:54:00Z","pushed_at":"2016-10-30T01:57:57Z","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":3646,"stargazers_count":929,"watchers_count":929,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":92,"mirror_url":null,"open_issues_count":300,"forks":92,"open_issues":300,"watchers":929,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307"},"html":{"href":"https://github.com/Manishearth/rust-clippy/pull/1307"},"issue":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1307"},"comments":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1307/comments"},"review_comments":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/1307/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/1307/commits"},"statuses":{"href":"https://api.github.com/repos/Manishearth/rust-clippy/statuses/ea977a9a85d8a7587aebcb0d5436a6b950071886"}}}}
{"actor":{"display_login":"oli-obk"}}