Skip to content

Commit 1064003

Browse files
committed
Use fragment instead of side channel for prim. assoc. items
I had the epiphany that now that fragments are "semantic" -- rather than just strings -- they fill the role that used to be handled by the side channel. I think I may be able to get rid of the other uses of the side channel using this technique too.
1 parent 7e3132a commit 1064003

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,9 @@ impl LinkCollector<'_, '_> {
13531353

13541354
match res {
13551355
Res::Primitive(prim) => {
1356-
if let Some((kind, id)) = self.kind_side_channel.take() {
1356+
if let Some(UrlFragment::Def(_, id)) = fragment {
1357+
let kind = self.cx.tcx.def_kind(id);
1358+
13571359
// We're actually resolving an associated item of a primitive, so we need to
13581360
// verify the disambiguator (if any) matches the type of the associated item.
13591361
// This case should really follow the same flow as the `Res::Def` branch below,

0 commit comments

Comments
 (0)