diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-01 10:06:27 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-02 07:30:11 +0000 |
| commit | 49c74d29fdb04aa419f911fe9a42d13ca743b715 (patch) | |
| tree | 1093599481c63fbbcc6091edbed83807b82bc07f /compiler/rustc_passes/src/dead.rs | |
| parent | 798987982c6a0077edd62c14123b0ac1d4941e6a (diff) | |
| download | rust-49c74d29fdb04aa419f911fe9a42d13ca743b715.tar.gz rust-49c74d29fdb04aa419f911fe9a42d13ca743b715.zip | |
Only walk local items instead of filtering for them later
Diffstat (limited to 'compiler/rustc_passes/src/dead.rs')
| -rw-r--r-- | compiler/rustc_passes/src/dead.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index f77e1db42d4..b62d94d65f1 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -421,10 +421,8 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { } hir::ItemKind::ForeignMod { .. } => {} hir::ItemKind::Trait(..) => { - for impl_def_id in self.tcx.all_impls(item.owner_id.to_def_id()) { - if let Some(local_def_id) = impl_def_id.as_local() - && let ItemKind::Impl(impl_ref) = - self.tcx.hir_expect_item(local_def_id).kind + for &impl_def_id in self.tcx.local_trait_impls(item.owner_id.def_id) { + if let ItemKind::Impl(impl_ref) = self.tcx.hir_expect_item(impl_def_id).kind { // skip items // mark dependent traits live |
