This is the lint described at https://github.com/rust-lang/rust/pull/136308#issuecomment-2625485331 that recommends using HTML to nest links inside code.
53 lines
1.3 KiB
Rust
53 lines
1.3 KiB
Rust
#![warn(clippy::doc_link_code)]
|
|
|
|
//! Test case for code links that are adjacent to code text.
|
|
//!
|
|
//! This is not an example: `first``second`
|
|
//!
|
|
//! Neither is this: [`first`](x)
|
|
//!
|
|
//! Neither is this: [`first`](x) `second`
|
|
//!
|
|
//! Neither is this: [first](x)`second`
|
|
//!
|
|
//! This is: <code>[first](x)second</code>
|
|
//~^ ERROR: adjacent
|
|
//!
|
|
//! So is this <code>first[second](x)</code>
|
|
//~^ ERROR: adjacent
|
|
//!
|
|
//! So is this <code>[first](x)[second](x)</code>
|
|
//~^ ERROR: adjacent
|
|
//!
|
|
//! So is this <code>[first](x)[second](x)[third](x)</code>
|
|
//~^ ERROR: adjacent
|
|
//!
|
|
//! So is this <code>[first](x)second[third](x)</code>
|
|
//~^ ERROR: adjacent
|
|
|
|
/// Test case for code links that are adjacent to code text.
|
|
///
|
|
/// This is not an example: `first``second` arst
|
|
///
|
|
/// Neither is this: [`first`](x) arst
|
|
///
|
|
/// Neither is this: [`first`](x) `second` arst
|
|
///
|
|
/// Neither is this: [first](x)`second` arst
|
|
///
|
|
/// This is: <code>[first](x)second</code> arst
|
|
//~^ ERROR: adjacent
|
|
///
|
|
/// So is this <code>first[second](x)</code> arst
|
|
//~^ ERROR: adjacent
|
|
///
|
|
/// So is this <code>[first](x)[second](x)</code> arst
|
|
//~^ ERROR: adjacent
|
|
///
|
|
/// So is this <code>[first](x)[second](x)[third](x)</code> arst
|
|
//~^ ERROR: adjacent
|
|
///
|
|
/// So is this <code>[first](x)second[third](x)</code> arst
|
|
//~^ ERROR: adjacent
|
|
pub struct WithTrailing;
|