]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/doc/unbalanced_ticks.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / doc / unbalanced_ticks.rs
1 //! This file tests for the `DOC_MARKDOWN` lint, specifically cases
2 //! where ticks are unbalanced (see issue #6753).
3
4 #![allow(dead_code)]
5 #![warn(clippy::doc_markdown)]
6
7 /// This is a doc comment with `unbalanced_tick marks and several words that
8 /// should be `encompassed_by` tick marks because they `contain_underscores`.
9 /// Because of the initial `unbalanced_tick` pair, the error message is
10 /// very `confusing_and_misleading`.
11 fn main() {}
12
13 /// This paragraph has `unbalanced_tick marks and should stop_linting.
14 ///
15 /// This paragraph is fine and should_be linted normally.
16 ///
17 /// Double unbalanced backtick from ``here to here` should lint.
18 ///
19 /// Double balanced back ticks ``start end`` is fine.
20 fn multiple_paragraphs() {}
21
22 /// ```
23 /// // Unbalanced tick mark in code block shouldn't warn:
24 /// `
25 /// ```
26 fn in_code_block() {}
27
28 /// # `Fine`
29 ///
30 /// ## not_fine
31 ///
32 /// ### `unbalanced
33 ///
34 /// - This `item has unbalanced tick marks
35 /// - This item needs backticks_here
36 fn other_markdown() {}
37
38 #[rustfmt::skip]
39 /// - ```rust
40 /// /// `lol`
41 /// pub struct Struct;
42 /// ```
43 fn iss_7421() {}