Skip to content

Commit 8ca13e8

Browse files
committed
Another fix for incorrect_impls
1 parent c2490bd commit 8ca13e8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tools/clippy/clippy_lints/src/incorrect_impls.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use clippy_utils::{get_parent_node, is_res_lang_ctor, last_path_segment, path_re
44
use rustc_errors::Applicability;
55
use rustc_hir::def::Res;
66
use rustc_hir::{Expr, ExprKind, ImplItem, ImplItemKind, ItemKind, LangItem, Node, UnOp};
7-
use rustc_hir_analysis::hir_ty_to_ty;
87
use rustc_lint::{LateContext, LateLintPass};
98
use rustc_middle::ty::EarlyBinder;
109
use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -121,7 +120,7 @@ impl LateLintPass<'_> for IncorrectImpls {
121120
if cx.tcx.is_automatically_derived(item.owner_id.to_def_id()) {
122121
return;
123122
}
124-
let ItemKind::Impl(imp) = item.kind else {
123+
let ItemKind::Impl(_) = item.kind else {
125124
return;
126125
};
127126
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 {
186185
.get(&sym::Ord)
187186
&& implements_trait(
188187
cx,
189-
hir_ty_to_ty(cx.tcx, imp.self_ty),
188+
trait_impl.self_ty(),
190189
*ord_def_id,
191-
trait_impl.args,
190+
&[],
192191
)
193192
{
194193
if block.stmts.is_empty()

0 commit comments

Comments
 (0)