diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-08 21:46:23 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-07-18 16:51:05 -0400 |
| commit | 8a0ccd30d1c31565e56a7c761bb392b8f1dfe542 (patch) | |
| tree | efcdc7a48b42a2f72b9b57123b9f62690390ce4e | |
| parent | b0209dc0289b20d77012f61a02062c87111d8420 (diff) | |
| download | rust-8a0ccd30d1c31565e56a7c761bb392b8f1dfe542.tar.gz rust-8a0ccd30d1c31565e56a7c761bb392b8f1dfe542.zip | |
Make clippy and rustdoc happy
| -rw-r--r-- | clippy_lints/src/inherent_impl.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs index 95ae591884b..0d3786dad4b 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -56,19 +56,18 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl { let Ok(impls) = cx.tcx.crate_inherent_impls(()) else { return; }; - let inherent_impls = cx - .tcx - .with_stable_hashing_context(|hcx| impls.inherent_impls.to_sorted(&hcx, true)); - for (_, impl_ids) in inherent_impls.into_iter().filter(|(&id, impls)| { - impls.len() > 1 + for (&id, impl_ids) in &impls.inherent_impls { + if impl_ids.len() < 2 // Check for `#[allow]` on the type definition - && !is_lint_allowed( + || is_lint_allowed( cx, MULTIPLE_INHERENT_IMPL, cx.tcx.local_def_id_to_hir_id(id), - ) - }) { + ) { + continue; + } + for impl_id in impl_ids.iter().map(|id| id.expect_local()) { let impl_ty = cx.tcx.type_of(impl_id).instantiate_identity(); match type_map.entry(impl_ty) { |
