Skip to content

Commit 52b15b4

Browse files
committed
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.
1 parent 6066037 commit 52b15b4

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/librustdoc/clean/types.rs

-17
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,6 @@ impl ExternalCrate {
232232
hir::ItemKind::Mod(_) => {
233233
as_keyword(Res::Def(DefKind::Mod, id.owner_id.to_def_id()))
234234
}
235-
hir::ItemKind::Use(path, hir::UseKind::Single)
236-
if tcx.visibility(id.owner_id).is_public() =>
237-
{
238-
path.res
239-
.iter()
240-
.find_map(|res| as_keyword(res.expect_non_local()))
241-
.map(|(_, prim)| (id.owner_id.to_def_id(), prim))
242-
}
243235
_ => None,
244236
}
245237
})
@@ -302,15 +294,6 @@ impl ExternalCrate {
302294
hir::ItemKind::Mod(_) => {
303295
as_primitive(Res::Def(DefKind::Mod, id.owner_id.to_def_id()))
304296
}
305-
hir::ItemKind::Use(path, hir::UseKind::Single)
306-
if tcx.visibility(id.owner_id).is_public() =>
307-
{
308-
path.res
309-
.iter()
310-
.find_map(|res| as_primitive(res.expect_non_local()))
311-
// Pretend the primitive is local.
312-
.map(|(_, prim)| (id.owner_id.to_def_id(), prim))
313-
}
314297
_ => None,
315298
}
316299
})

tests/rustdoc/issue-15318-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern crate issue_15318;
66

77
pub use issue_15318::ptr;
88

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

0 commit comments

Comments
 (0)