diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2022-01-05 18:27:06 -0800 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2022-01-06 11:48:47 -0800 |
| commit | fde94538bf893fe11148354bc2da0028207ea47c (patch) | |
| tree | 7f8e548b5d5149d8b752bf334c540baccaf858c9 | |
| parent | 1064003f8c39e138c3fefa9104fd74ffe81df3e8 (diff) | |
| download | rust-fde94538bf893fe11148354bc2da0028207ea47c.tar.gz rust-fde94538bf893fe11148354bc2da0028207ea47c.zip | |
Use fragment instead of side channel in another place
| -rw-r--r-- | src/librustdoc/passes/collect_intra_doc_links.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index fe390f6354c..6711028ab1b 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -1309,7 +1309,11 @@ impl LinkCollector<'_, '_> { }; let verify = |kind: DefKind, id: DefId| { - let (kind, id) = self.kind_side_channel.take().unwrap_or((kind, id)); + let (kind, id) = if let Some(UrlFragment::Def(_, id)) = fragment { + (self.cx.tcx.def_kind(id), id) + } else { + (kind, id) + }; debug!("intra-doc link to {} resolved to {:?} (id: {:?})", path_str, res, id); // Disallow e.g. linking to enums with `struct@` |
