Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustdoc/passes/check_doc_test_visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ crate fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item) {
);
}
} else if tests.found_tests > 0
&& !cx.cache.access_levels.is_public(item.def_id.expect_def_id())
&& !cx.cache.access_levels.is_exported(item.def_id.expect_def_id())
{
cx.tcx.struct_span_lint_hir(
crate::lint::PRIVATE_DOC_TESTS,
Expand Down
14 changes: 14 additions & 0 deletions src/test/rustdoc-ui/public-reexported-item-doc-test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// check-pass

#![deny(rustdoc::private_doc_tests)]

mod foo {
/// re-exported doc test
///
/// ```
/// assert!(true);
/// ```
pub fn bar() {}
}

pub use foo::bar;