Prevent showing methods from blanket impls of not available foreign traits to show up in the search results
This commit is contained in:
parent
6d05c430d2
commit
a314707867
@ -310,7 +310,19 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
|
||||
for_: clean::Type::BorrowedRef { type_, .. },
|
||||
..
|
||||
} => type_.def_id(&self.cache),
|
||||
ParentStackItem::Impl { for_, .. } => for_.def_id(&self.cache),
|
||||
ParentStackItem::Impl { for_, trait_, .. } => {
|
||||
if let Some(trait_) = trait_ {
|
||||
let trait_did = trait_.def_id();
|
||||
// If this is a foreign trait impl but the trait documentation
|
||||
// is not available, we should not allow the methods to show up
|
||||
// in the search results.
|
||||
if !trait_did.is_local() && self.tcx.is_private_dep(trait_did.krate)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
}
|
||||
for_.def_id(&self.cache)
|
||||
}
|
||||
ParentStackItem::Type(item_id) => item_id.as_def_id(),
|
||||
};
|
||||
let path = did
|
||||
|
Loading…
x
Reference in New Issue
Block a user