Skip to content

Commit 2bdbb0d

Browse files
committed
Document hackiness around primitive associated item disambiguators
1 parent 6f04133 commit 2bdbb0d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,14 @@ impl LinkCollector<'_, '_> {
11931193
match res {
11941194
Res::Primitive(_) => {
11951195
if let Some((kind, id)) = self.kind_side_channel.take() {
1196+
// We're actually resolving an associated item of a primitive, so we need to
1197+
// verify the disambiguator (if any) matches the type of the associated item.
1198+
// This case should really follow the same flow as the `Res::Def` branch below,
1199+
// but attempting to add a call to `clean::register_res` causes an ICE. @jyn514
1200+
// thinks `register_res` is only needed for cross-crate re-exports, but Rust
1201+
// doesn't allow statements like `use str::trim;`, making this a (hopefully)
1202+
// valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677
1203+
// for discussion on the matter.
11961204
verify(kind, id)?;
11971205
} else {
11981206
match disambiguator {

0 commit comments

Comments
 (0)