Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion clippy_lints/src/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,12 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
);
refdefrange.start - range.start
} else {
next_range.start - range.start
let mut start = next_range.start;
if start > 0 && doc.as_bytes().get(start - 1) == Some(&b'\\') {
// backslashes aren't in the event stream...
start -= 1;
}
start - range.start
}
} else {
0
Expand Down
6 changes: 6 additions & 0 deletions tests/ui/doc/doc_lazy_list.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ fn seven() {}
/// ]
//~^ ERROR: doc list item without indentation
fn eight() {}

#[rustfmt::skip]
// https://github.com/rust-lang/rust-clippy/issues/13705
/// - \[text in square brackets\] with a long following description
/// that goes over multiple lines
pub fn backslash_escaped_square_braces() {}
6 changes: 6 additions & 0 deletions tests/ui/doc/doc_lazy_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ fn seven() {}
/// ]
//~^ ERROR: doc list item without indentation
fn eight() {}

#[rustfmt::skip]
// https://github.com/rust-lang/rust-clippy/issues/13705
/// - \[text in square brackets\] with a long following description
/// that goes over multiple lines
pub fn backslash_escaped_square_braces() {}
Loading