Skip to content

doc_markdown: item in documentation is missing backticks broken #16819

@daniel-pfeiffer

Description

@daniel-pfeiffer

Summary

If I have things in braces (normal characters in standard markdown) that clippy wants to backtick, it’s fine if they are distant. But adjacent with a dot in between it gets totally confused.

Reproducer

Code:

/// We have {SymbolA} and {symbol_b}.
/// We have {SymbolA}.{symbol_b}.

Current output:

37 - /// We have {SymbolA} and {symbol_b}.
37 + /// We have {`SymbolA`} and {symbol_b}.
…
37 - /// We have {SymbolA} and {symbol_b}.
37 + /// We have {SymbolA} and {`symbol_b`}.
…
38 - /// We have {SymbolA}.{symbol_b}.
38 + /// We have {`SymbolA}.{symbol_b`}.
                          ^^^

Desired output:

…
38 - /// We have {SymbolA}.{symbol_b}.
38 + /// We have {`SymbolA`}.{`symbol_b`}.
                          ^^^^^

Version

(Same happens on recent nightly.)

rustc 1.94.1 (e408947bf 2026-03-25)
binary: rustc
commit-hash: e408947bfd200af42db322daf0fadfe7e26d3bd1
commit-date: 2026-03-25
host: x86_64-unknown-linux-gnu
release: 1.94.1
LLVM version: 21.1.8

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions