Skip to content

Commit fde9453

Browse files
committed
Use fragment instead of side channel in another place
1 parent 1064003 commit fde9453

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,11 @@ impl LinkCollector<'_, '_> {
13091309
};
13101310

13111311
let verify = |kind: DefKind, id: DefId| {
1312-
let (kind, id) = self.kind_side_channel.take().unwrap_or((kind, id));
1312+
let (kind, id) = if let Some(UrlFragment::Def(_, id)) = fragment {
1313+
(self.cx.tcx.def_kind(id), id)
1314+
} else {
1315+
(kind, id)
1316+
};
13131317
debug!("intra-doc link to {} resolved to {:?} (id: {:?})", path_str, res, id);
13141318

13151319
// Disallow e.g. linking to enums with `struct@`

0 commit comments

Comments
 (0)