diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index eafe6f17d44..b0f7836a834 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -1312,7 +1312,19 @@ fn markdown_summary_with_limit(
let iter = Footnotes::new(HeadingLinks::new(p, None, &mut ids, HeadingOffset::H1));
for ev in iter {
- if let Event::Start(Tag::Link(kind, dest, _)) = ev.0 {
+ if let Event::Start(Tag::Link(
+ // `<>` links cannot be intra-doc links so we skip them.
+ kind @ (LinkType::Inline
+ | LinkType::Reference
+ | LinkType::ReferenceUnknown
+ | LinkType::Collapsed
+ | LinkType::CollapsedUnknown
+ | LinkType::Shortcut
+ | LinkType::ShortcutUnknown),
+ dest,
+ _,
+ )) = ev.0
+ {
debug!("found link: {dest}");
let span = span_for_link(&dest, ev.1);
filter_map(MarkdownLink { kind, link: dest.into_string(), range: span })