don't check visibility when inlining local impls

those get handled properly in strip-hidden anyway
This commit is contained in:
QuietMisdreavus 2018-08-21 16:22:20 -05:00
parent a45d38744c
commit e79780f18f
2 changed files with 38 additions and 6 deletions

View File

@ -309,9 +309,11 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
// Only inline impl if the implemented trait is
// reachable in rustdoc generated documentation
if let Some(traitref) = associated_trait {
if !cx.access_levels.borrow().is_doc_reachable(traitref.def_id) {
return
if !did.is_local() {
if let Some(traitref) = associated_trait {
if !cx.access_levels.borrow().is_doc_reachable(traitref.def_id) {
return
}
}
}
@ -328,9 +330,11 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
// Only inline impl if the implementing type is
// reachable in rustdoc generated documentation
if let Some(did) = for_.def_id() {
if !cx.access_levels.borrow().is_doc_reachable(did) {
return
if !did.is_local() {
if let Some(did) = for_.def_id() {
if !cx.access_levels.borrow().is_doc_reachable(did) {
return
}
}
}

View File

@ -0,0 +1,28 @@
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub trait ThisTrait {}
mod asdf {
use ThisTrait;
pub struct SomeStruct;
impl ThisTrait for SomeStruct {}
trait PrivateTrait {}
impl PrivateTrait for SomeStruct {}
}
// @has trait_vis/struct.SomeStruct.html
// @has - '//code' 'impl ThisTrait for SomeStruct'
// !@has - '//code' 'impl PrivateTrait for SomeStruct'
pub use asdf::SomeStruct;