about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2023-07-17 10:22:49 +0200
committerPhilipp Krones <hello@philkrones.com>2023-07-17 10:22:49 +0200
commit2feb9a582f50e4322f620823ce195dfb346752fd (patch)
treea8328729c7e112c931d729043608095b10fad406
parentd6d530fd0b92ccec4a22e69cdebe6c4c942c8166 (diff)
downloadrust-2feb9a582f50e4322f620823ce195dfb346752fd.tar.gz
rust-2feb9a582f50e4322f620823ce195dfb346752fd.zip
Another fix for incorrect_impls
-rw-r--r--clippy_lints/src/incorrect_impls.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/clippy_lints/src/incorrect_impls.rs b/clippy_lints/src/incorrect_impls.rs
index c5da6039ac3..e6c42ebb832 100644
--- a/clippy_lints/src/incorrect_impls.rs
+++ b/clippy_lints/src/incorrect_impls.rs
@@ -4,7 +4,6 @@ use clippy_utils::{get_parent_node, is_res_lang_ctor, last_path_segment, path_re
 use rustc_errors::Applicability;
 use rustc_hir::def::Res;
 use rustc_hir::{Expr, ExprKind, ImplItem, ImplItemKind, ItemKind, LangItem, Node, UnOp};
-use rustc_hir_analysis::hir_ty_to_ty;
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_middle::ty::EarlyBinder;
 use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -121,7 +120,7 @@ impl LateLintPass<'_> for IncorrectImpls {
         if cx.tcx.is_automatically_derived(item.owner_id.to_def_id()) {
             return;
         }
-        let ItemKind::Impl(imp) = item.kind else {
+        let ItemKind::Impl(_) = item.kind else {
             return;
         };
         let ImplItemKind::Fn(_, impl_item_id) = cx.tcx.hir().impl_item(impl_item.impl_item_id()).kind else {
@@ -186,9 +185,9 @@ impl LateLintPass<'_> for IncorrectImpls {
                 .get(&sym::Ord)
             && implements_trait(
                     cx,
-                    hir_ty_to_ty(cx.tcx, imp.self_ty),
+                    trait_impl.self_ty(),
                     *ord_def_id,
-                    trait_impl.args,
+                    &[],
                 )
         {
             if block.stmts.is_empty()