Skip to content

Commit

Permalink
rustdoc: Unsupport importing doc(primitive) and doc(keyword) modules
Browse files Browse the repository at this point in the history
These are internal features used for a specific purpose, and modules without imports are enough for that purpose.
  • Loading branch information
petrochenkov committed Mar 28, 2023
1 parent 6066037 commit 52b15b4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,6 @@ impl ExternalCrate {
hir::ItemKind::Mod(_) => {
as_keyword(Res::Def(DefKind::Mod, id.owner_id.to_def_id()))
}
hir::ItemKind::Use(path, hir::UseKind::Single)
if tcx.visibility(id.owner_id).is_public() =>
{
path.res
.iter()
.find_map(|res| as_keyword(res.expect_non_local()))
.map(|(_, prim)| (id.owner_id.to_def_id(), prim))
}
_ => None,
}
})
Expand Down Expand Up @@ -302,15 +294,6 @@ impl ExternalCrate {
hir::ItemKind::Mod(_) => {
as_primitive(Res::Def(DefKind::Mod, id.owner_id.to_def_id()))
}
hir::ItemKind::Use(path, hir::UseKind::Single)
if tcx.visibility(id.owner_id).is_public() =>
{
path.res
.iter()
.find_map(|res| as_primitive(res.expect_non_local()))
// Pretend the primitive is local.
.map(|(_, prim)| (id.owner_id.to_def_id(), prim))
}
_ => None,
}
})
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc/issue-15318-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extern crate issue_15318;

pub use issue_15318::ptr;

// @has issue_15318_2/fn.bar.html \
// @!has issue_15318_2/fn.bar.html \
// '//*[@href="primitive.pointer.html"]' \
// '*mut T'
pub fn bar<T>(ptr: *mut T) {}

0 comments on commit 52b15b4

Please sign in to comment.