Skip to content

Commit 50fa16f

Browse files
undo some tweaks to build_impl
1 parent 804a1a6 commit 50fa16f

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ pub fn build_impls(cx: &DocContext, did: DefId, auto_traits: bool) -> Vec<clean:
296296

297297
pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
298298
if !cx.renderinfo.borrow_mut().inlined.insert(did) {
299-
debug!("already inlined, bailing: {:?}", did);
300299
return
301300
}
302301

@@ -306,25 +305,19 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
306305

307306
// Only inline impl if the implemented trait is
308307
// reachable in rustdoc generated documentation
309-
if !did.is_local() {
310-
if let Some(traitref) = associated_trait {
311-
if !cx.access_levels.borrow().is_doc_reachable(traitref.def_id) {
312-
debug!("trait {:?} not reachable, bailing: {:?}", traitref.def_id, did);
313-
return
314-
}
308+
if let Some(traitref) = associated_trait {
309+
if !cx.access_levels.borrow().is_doc_reachable(traitref.def_id) {
310+
return
315311
}
316312
}
317313

318314
let for_ = tcx.type_of(did).clean(cx);
319315

320316
// Only inline impl if the implementing type is
321317
// reachable in rustdoc generated documentation
322-
if !did.is_local() {
323-
if let Some(did) = for_.def_id() {
324-
if !cx.access_levels.borrow().is_doc_reachable(did) {
325-
debug!("impl type {:?} not accessible, bailing", did);
326-
return
327-
}
318+
if let Some(did) = for_.def_id() {
319+
if !cx.access_levels.borrow().is_doc_reachable(did) {
320+
return
328321
}
329322
}
330323

@@ -357,6 +350,8 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
357350
.collect()
358351
}).unwrap_or(FxHashSet());
359352

353+
debug!("build_impl: impl {:?} for {:?}", trait_.def_id(), for_.def_id());
354+
360355
ret.push(clean::Item {
361356
inner: clean::ImplItem(clean::Impl {
362357
unsafety: hir::Unsafety::Normal,

0 commit comments

Comments
 (0)