diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2023-07-30 00:00:19 -0400 |
|---|---|---|
| committer | Jason Newcomb <jsnewcomb@pm.me> | 2023-07-30 00:38:04 -0400 |
| commit | 71cc39e1f2f4cd7e8cd6fa09c65ecab06ce9cc80 (patch) | |
| tree | 5385b60cf738288cddeb7791ee62bf061c917c14 /clippy_lints/src/incorrect_impls.rs | |
| parent | 29730969b196781e92ca8c8b2d0a8bf9bb105e22 (diff) | |
| download | rust-71cc39e1f2f4cd7e8cd6fa09c65ecab06ce9cc80.tar.gz rust-71cc39e1f2f4cd7e8cd6fa09c65ecab06ce9cc80.zip | |
Add debug assertions to `implements_trait`
Improve debug assertions for `make_projection`
Diffstat (limited to 'clippy_lints/src/incorrect_impls.rs')
| -rw-r--r-- | clippy_lints/src/incorrect_impls.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clippy_lints/src/incorrect_impls.rs b/clippy_lints/src/incorrect_impls.rs index bce010bb168..f4edb17ae80 100644 --- a/clippy_lints/src/incorrect_impls.rs +++ b/clippy_lints/src/incorrect_impls.rs @@ -189,12 +189,8 @@ impl LateLintPass<'_> for IncorrectImpls { .diagnostic_items(trait_impl.def_id.krate) .name_to_id .get(&sym::Ord) - && implements_trait( - cx, - hir_ty_to_ty(cx.tcx, imp.self_ty), - *ord_def_id, - trait_impl.args, - ) + && trait_impl.self_ty() == trait_impl.args.type_at(1) + && implements_trait(cx, hir_ty_to_ty(cx.tcx, imp.self_ty), *ord_def_id, &[]) { // If the `cmp` call likely needs to be fully qualified in the suggestion // (like `std::cmp::Ord::cmp`). It's unfortunate we must put this here but we can't |
