rust-clippy/tests/ui/doc/doc_lazy_blockquote.fixed
Michael Howell f3dd31e214 Add lint for markdown lazy paragraph continuations
This is a follow-up for https://github.com/rust-lang/rust/pull/121659,
since most cases of unintended block quotes are lazy continuations.
The lint is designed to be more generally useful than that, though,
because it will also catch unintended list items and unintended
block quotes that didn't coincidentally hit a pulldown-cmark bug.
2024-05-06 16:31:21 -07:00

47 lines
949 B
Rust

#![warn(clippy::doc_lazy_continuation)]
/// > blockquote with
/// > lazy continuation
//~^ ERROR: doc quote missing `>` marker
fn first() {}
/// > blockquote with no
/// > lazy continuation
fn first_nowarn() {}
/// > blockquote with no
///
/// lazy continuation
fn two_nowarn() {}
/// > nest here
/// >
/// > > nest here
/// > > lazy continuation
//~^ ERROR: doc quote missing `>` marker
fn two() {}
/// > nest here
/// >
/// > > nest here
/// > > lazy continuation
//~^ ERROR: doc quote missing `>` marker
fn three() {}
/// > * > nest here
/// > > lazy continuation
//~^ ERROR: doc quote missing `>` marker
fn four() {}
/// > * > nest here
/// > > lazy continuation
//~^ ERROR: doc quote missing `>` marker
fn four_point_1() {}
/// * > nest here lazy continuation
fn five() {}
/// 1. > nest here
/// > lazy continuation (this results in strange indentation, but still works)
//~^ ERROR: doc quote missing `>` marker
fn six() {}