diff options
| author | max-heller <max.a.heller@gmail.com> | 2021-01-05 15:15:25 -0500 |
|---|---|---|
| committer | max-heller <max.a.heller@gmail.com> | 2021-01-05 15:15:25 -0500 |
| commit | 2bdbb0d1b4a8be7e8fef6d1e35856190f5c91e0f (patch) | |
| tree | 688f5c821c00a3bdb9fce7a9fc5a99e816833ef7 | |
| parent | 6f0413316f786dc27de5af8d15a070f368f8746d (diff) | |
| download | rust-2bdbb0d1b4a8be7e8fef6d1e35856190f5c91e0f.tar.gz rust-2bdbb0d1b4a8be7e8fef6d1e35856190f5c91e0f.zip | |
Document hackiness around primitive associated item disambiguators
| -rw-r--r-- | src/librustdoc/passes/collect_intra_doc_links.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index f8e37d7bb56..11ee59b2401 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -1193,6 +1193,14 @@ impl LinkCollector<'_, '_> { match res { Res::Primitive(_) => { if let Some((kind, id)) = self.kind_side_channel.take() { + // We're actually resolving an associated item of a primitive, so we need to + // verify the disambiguator (if any) matches the type of the associated item. + // This case should really follow the same flow as the `Res::Def` branch below, + // but attempting to add a call to `clean::register_res` causes an ICE. @jyn514 + // thinks `register_res` is only needed for cross-crate re-exports, but Rust + // doesn't allow statements like `use str::trim;`, making this a (hopefully) + // valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677 + // for discussion on the matter. verify(kind, id)?; } else { match disambiguator { |
