Only walk local items instead of filtering for them later
This commit is contained in:
parent
798987982c
commit
49c74d29fd
2 changed files with 18 additions and 22 deletions
|
@ -1730,8 +1730,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
||||||
.is_accessible_from(self.item_def_id(), tcx)
|
.is_accessible_from(self.item_def_id(), tcx)
|
||||||
&& tcx.all_impls(*trait_def_id)
|
&& tcx.all_impls(*trait_def_id)
|
||||||
.any(|impl_def_id| {
|
.any(|impl_def_id| {
|
||||||
let impl_header = tcx.impl_trait_header(impl_def_id);
|
let header = tcx.impl_trait_header(impl_def_id).unwrap();
|
||||||
impl_header.is_some_and(|header| {
|
|
||||||
let trait_ref = header.trait_ref.instantiate(
|
let trait_ref = header.trait_ref.instantiate(
|
||||||
tcx,
|
tcx,
|
||||||
infcx.fresh_args_for_item(DUMMY_SP, impl_def_id),
|
infcx.fresh_args_for_item(DUMMY_SP, impl_def_id),
|
||||||
|
@ -1750,7 +1749,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
||||||
) && header.polarity != ty::ImplPolarity::Negative
|
) && header.polarity != ty::ImplPolarity::Negative
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
.map(|trait_def_id| tcx.def_path_str(trait_def_id))
|
.map(|trait_def_id| tcx.def_path_str(trait_def_id))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
|
@ -421,10 +421,8 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
|
||||||
}
|
}
|
||||||
hir::ItemKind::ForeignMod { .. } => {}
|
hir::ItemKind::ForeignMod { .. } => {}
|
||||||
hir::ItemKind::Trait(..) => {
|
hir::ItemKind::Trait(..) => {
|
||||||
for impl_def_id in self.tcx.all_impls(item.owner_id.to_def_id()) {
|
for &impl_def_id in self.tcx.local_trait_impls(item.owner_id.def_id) {
|
||||||
if let Some(local_def_id) = impl_def_id.as_local()
|
if let ItemKind::Impl(impl_ref) = self.tcx.hir_expect_item(impl_def_id).kind
|
||||||
&& let ItemKind::Impl(impl_ref) =
|
|
||||||
self.tcx.hir_expect_item(local_def_id).kind
|
|
||||||
{
|
{
|
||||||
// skip items
|
// skip items
|
||||||
// mark dependent traits live
|
// mark dependent traits live
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue