Skip to content

Commit

Permalink
fix intra doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonszelmann committed Oct 17, 2024
1 parent 596412d commit cefa0ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/rustc_resolve/src/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ pub fn attrs_to_doc_fragments<'a, A: AttributeExt + Clone + 'a>(
let (span, kind) = if attr.is_doc_comment() {
(attr.span(), DocFragmentKind::SugaredDoc)
} else {
(attr.value_span().unwrap(), DocFragmentKind::RawDoc)
(
attr.value_span()
.map(|i| i.with_ctxt(attr.span().ctxt()))
.unwrap_or(attr.span()),
DocFragmentKind::RawDoc,
)
};
let fragment = DocFragment { span, doc, kind, item_id, indent: 0 };
doc_fragments.push(fragment);
Expand Down

0 comments on commit cefa0ea

Please sign in to comment.