Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 0 additions & 2 deletions src/librustdoc/formats/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ impl Cache {
self.primitive_locations.insert(prim, def_id);
}

self.stack.push(krate.name.to_string());

krate = CacheBuilder { tcx, cache: self, empty_cache: Cache::default() }.fold_crate(krate);

for (trait_did, dids, impl_) in self.orphan_trait_impls.drain(..) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
&Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Public },
hir::CRATE_HIR_ID,
&krate.item.module,
None,
Some(self.cx.tcx.crate_name),
);
top_level_module.is_crate = true;
// Attach the crate's exported macros to the top-level module.
Expand Down
6 changes: 6 additions & 0 deletions src/test/rustdoc-ui/intra-doc/private-from-crate-level.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// check-pass

//! [my_module]
//~^ WARN public documentation for `private_from_crate_level` links to private item `my_module`

mod my_module {}
11 changes: 11 additions & 0 deletions src/test/rustdoc-ui/intra-doc/private-from-crate-level.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: public documentation for `private_from_crate_level` links to private item `my_module`
--> $DIR/private-from-crate-level.rs:3:6
|
LL | //! [my_module]
| ^^^^^^^^^ this item is private
|
= note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`

warning: 1 warning emitted