List item in doc comment starting with escaped [
makes clippy calculate indent wrong
#13705
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
If a list item in a doc comment starts with
\[
(to stop rustdoc from making a link), clippy calculates the expected indent for the rest of the lines of the list item incorrecly, suggesting to add additional indentation. A\]
triggers this bug also, but e.g.\x
doesn't.This is both a false positive and a false negative bc clippy expects the wrong indentation
Playground
Reproducer
I tried this code:
I expected to see this happen:
No warning
Instead, this happened:
Clippy warns:
Version
Additional Labels
@rustbot label +I-false-positive +I-false-negative
The text was updated successfully, but these errors were encountered: