undo some tweaks to build_impl
This commit is contained in:
parent
804a1a6fa9
commit
50fa16f5b5
1 changed files with 8 additions and 13 deletions
|
@ -296,7 +296,6 @@ pub fn build_impls(cx: &DocContext, did: DefId, auto_traits: bool) -> Vec<clean:
|
||||||
|
|
||||||
pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
|
pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
|
||||||
if !cx.renderinfo.borrow_mut().inlined.insert(did) {
|
if !cx.renderinfo.borrow_mut().inlined.insert(did) {
|
||||||
debug!("already inlined, bailing: {:?}", did);
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,12 +305,9 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
|
||||||
|
|
||||||
// Only inline impl if the implemented trait is
|
// Only inline impl if the implemented trait is
|
||||||
// reachable in rustdoc generated documentation
|
// reachable in rustdoc generated documentation
|
||||||
if !did.is_local() {
|
if let Some(traitref) = associated_trait {
|
||||||
if let Some(traitref) = associated_trait {
|
if !cx.access_levels.borrow().is_doc_reachable(traitref.def_id) {
|
||||||
if !cx.access_levels.borrow().is_doc_reachable(traitref.def_id) {
|
return
|
||||||
debug!("trait {:?} not reachable, bailing: {:?}", traitref.def_id, did);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,12 +315,9 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
|
||||||
|
|
||||||
// Only inline impl if the implementing type is
|
// Only inline impl if the implementing type is
|
||||||
// reachable in rustdoc generated documentation
|
// reachable in rustdoc generated documentation
|
||||||
if !did.is_local() {
|
if let Some(did) = for_.def_id() {
|
||||||
if let Some(did) = for_.def_id() {
|
if !cx.access_levels.borrow().is_doc_reachable(did) {
|
||||||
if !cx.access_levels.borrow().is_doc_reachable(did) {
|
return
|
||||||
debug!("impl type {:?} not accessible, bailing", did);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,6 +350,8 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
|
||||||
.collect()
|
.collect()
|
||||||
}).unwrap_or(FxHashSet());
|
}).unwrap_or(FxHashSet());
|
||||||
|
|
||||||
|
debug!("build_impl: impl {:?} for {:?}", trait_.def_id(), for_.def_id());
|
||||||
|
|
||||||
ret.push(clean::Item {
|
ret.push(clean::Item {
|
||||||
inner: clean::ImplItem(clean::Impl {
|
inner: clean::ImplItem(clean::Impl {
|
||||||
unsafety: hir::Unsafety::Normal,
|
unsafety: hir::Unsafety::Normal,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue