Skip to content

Commit dc3899e

Browse files
undo some tweaks to build_impl
1 parent 033fd7a commit dc3899e

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
@@ -295,7 +295,6 @@ pub fn build_impls(cx: &DocContext, did: DefId, auto_traits: bool) -> Vec<clean:
295295

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)