Make associated_items query return a slice
This commit is contained in:
parent
6cad7542da
commit
66fd4e6ed8
25 changed files with 62 additions and 48 deletions
|
|
@ -115,6 +115,8 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
|
|||
.cx
|
||||
.tcx
|
||||
.associated_items(impl_def_id)
|
||||
.iter()
|
||||
.copied()
|
||||
.collect::<Vec<_>>()
|
||||
.clean(self.cx),
|
||||
polarity: None,
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ pub fn record_extern_fqn(cx: &DocContext<'_>, did: DefId, kind: clean::TypeKind)
|
|||
|
||||
pub fn build_external_trait(cx: &DocContext<'_>, did: DefId) -> clean::Trait {
|
||||
let auto_trait = cx.tcx.trait_def(did).has_auto_impl;
|
||||
let trait_items = cx.tcx.associated_items(did).map(|item| item.clean(cx)).collect();
|
||||
let trait_items = cx.tcx.associated_items(did).iter().map(|item| item.clean(cx)).collect();
|
||||
let predicates = cx.tcx.predicates_of(did);
|
||||
let generics = (cx.tcx.generics_of(did), predicates).clean(cx);
|
||||
let generics = filter_non_trait_generics(did, generics);
|
||||
|
|
@ -376,6 +376,7 @@ pub fn build_impl(
|
|||
} else {
|
||||
(
|
||||
tcx.associated_items(did)
|
||||
.iter()
|
||||
.filter_map(|item| {
|
||||
if associated_trait.is_some() || item.vis == ty::Visibility::Public {
|
||||
Some(item.clean(cx))
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
|
|||
return cx
|
||||
.tcx
|
||||
.associated_items(did)
|
||||
.iter()
|
||||
.find(|item| item.ident.name == item_name)
|
||||
.and_then(|item| match item.kind {
|
||||
ty::AssocKind::Method => Some("method"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue