Skip to content

Commit 1920abd

Browse files
committed
fix intra doc links
1 parent 928613a commit 1920abd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_resolve/src/rustdoc.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ pub fn attrs_to_doc_fragments<'a, A: AttributeExt + Clone + 'a>(
205205
let (span, kind) = if attr.is_doc_comment() {
206206
(attr.span(), DocFragmentKind::SugaredDoc)
207207
} else {
208-
(attr.value_span().unwrap(), DocFragmentKind::RawDoc)
208+
(
209+
attr.value_span()
210+
.map(|i| i.with_ctxt(attr.span().ctxt()))
211+
.unwrap_or(attr.span()),
212+
DocFragmentKind::RawDoc,
213+
)
209214
};
210215
let fragment = DocFragment { span, doc, kind, item_id, indent: 0 };
211216
doc_fragments.push(fragment);

0 commit comments

Comments
 (0)