diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-01 10:03:55 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-02 07:30:11 +0000 |
| commit | 777c7cdce0713762c5b6c278dae017ef0aefd8c8 (patch) | |
| tree | 4dea43a0e680d26afe7b535456c4328213a5a717 | |
| parent | 86e6cb5608457f59c90fd1dc3914fa2a6c4adbf0 (diff) | |
| download | rust-777c7cdce0713762c5b6c278dae017ef0aefd8c8.tar.gz rust-777c7cdce0713762c5b6c278dae017ef0aefd8c8.zip | |
Remove a function that has no necessary callers
| -rw-r--r-- | clippy_lints/src/new_without_default.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index f0ee613791f..1e469c3b63a 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -97,14 +97,14 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault { { if self.impling_types.is_none() { let mut impls = HirIdSet::default(); - cx.tcx.for_each_impl(default_trait_id, |d| { + for &d in cx.tcx.local_trait_impls(default_trait_id) { let ty = cx.tcx.type_of(d).instantiate_identity(); if let Some(ty_def) = ty.ty_adt_def() { if let Some(local_def_id) = ty_def.did().as_local() { impls.insert(cx.tcx.local_def_id_to_hir_id(local_def_id)); } } - }); + } self.impling_types = Some(impls); } |
