未验证 提交 3d645a3f 编写于 作者: D Dylan DPC 提交者: GitHub

Rollup merge of #83399 - camelid:rustdoc-priv-link-from-crate, r=jyn514

rustdoc: Record crate name instead of using `None`

Fixes #83365.

r? `@jyn514`
......@@ -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(..) {
......
......@@ -76,7 +76,7 @@ fn store_path(&mut self, did: DefId) {
&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.
......
// check-pass
//! [my_module]
//~^ WARN public documentation for `private_from_crate_level` links to private item `my_module`
mod my_module {}
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册