diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-03-23 18:47:49 +0400 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-03-28 17:31:39 +0400 |
| commit | 52b15b4bf9f3a24b44017fe4b1c114a6d91f1e88 (patch) | |
| tree | e4fc88e4a07036bf14d4f22aeba9760ae0aacd5c | |
| parent | 60660371efe59dfc99644e9d709a1b71e25ae2ac (diff) | |
| download | rust-52b15b4bf9f3a24b44017fe4b1c114a6d91f1e88.tar.gz rust-52b15b4bf9f3a24b44017fe4b1c114a6d91f1e88.zip | |
rustdoc: Unsupport importing `doc(primitive)` and `doc(keyword)` modules
These are internal features used for a specific purpose, and modules without imports are enough for that purpose.
| -rw-r--r-- | src/librustdoc/clean/types.rs | 17 | ||||
| -rw-r--r-- | tests/rustdoc/issue-15318-2.rs | 2 |
2 files changed, 1 insertions, 18 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 9019a6c49ec..93c2b5e069c 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -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, } }) @@ -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, } }) diff --git a/tests/rustdoc/issue-15318-2.rs b/tests/rustdoc/issue-15318-2.rs index f7f5052a36d..614f2c1c08e 100644 --- a/tests/rustdoc/issue-15318-2.rs +++ b/tests/rustdoc/issue-15318-2.rs @@ -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) {} |
