rustdoc: Record crate name instead of using None
This commit is contained in:
parent
2287a8823d
commit
72a180e134
@ -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.
|
||||
|
@ -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 {}
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user