1 //! This file tests for the DOC_MARKDOWN lint
2 //~^ ERROR: you should put `DOC_MARKDOWN` between ticks
9 /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
10 //~^ ERROR: you should put `foo_bar` between ticks
11 //~| ERROR: you should put `foo::bar` between ticks
12 /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun
13 //~^ ERROR: you should put `Foo::some_fun` between ticks
14 /// which should be reported only once despite being __doubly bad__.
15 /// Here be ::is::a::global:path.
16 //~^ ERROR: you should put `is::a::global:path` between ticks
17 /// That's not code ~NotInCodeBlock~.
18 //~^ ERROR: you should put `NotInCodeBlock` between ticks
19 /// be_sure_we_got_to_the_end_of_it
20 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
24 /// That one tests multiline ticks.
34 /// be_sure_we_got_to_the_end_of_it
35 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
36 fn multiline_codeblock() {
39 /// This _is a test for
42 /// be_sure_we_got_to_the_end_of_it
43 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
47 /// This tests units. See also #835.
48 /// kiB MiB GiB TiB PiB EiB
49 /// kib Mib Gib Tib Pib Eib
52 /// 32kiB 32MiB 32GiB 32TiB 32PiB 32EiB
53 /// 32kib 32Mib 32Gib 32Tib 32Pib 32Eib
54 /// 32kB 32MB 32GB 32TB 32PB 32EB
55 /// 32kb 32Mb 32Gb 32Tb 32Pb 32Eb
57 /// be_sure_we_got_to_the_end_of_it
58 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
62 /// This one checks we don’t try to split unicode codepoints
68 //~^ ERROR: you should put `ß_foo` between ticks
70 //~^ ERROR: you should put `ℝ_foo` between ticks
74 //~^ ERROR: you should put `foo_ß` between ticks
76 //~^ ERROR: you should put `foo_ℝ` between ticks
79 /// [ßdummy textß][foo_1ß]
80 /// [ℝdummy textℝ][foo_2ℝ]
81 /// [💣dummy tex💣t][foo3_💣]
82 /// [❤️dummy text❤️][foo_4❤️]
83 /// [ßdummy textß](foo_5ß)
84 /// [ℝdummy textℝ](foo_6ℝ)
85 /// [💣dummy tex💣t](fo7o_💣)
86 /// [❤️dummy text❤️](foo_8❤️)
87 /// [foo1_ß]: dummy text
88 /// [foo2_ℝ]: dummy text
89 /// [foo3_💣]: dummy text
90 /// [foo4_❤️]: dummy text
91 /// be_sure_we_got_to_the_end_of_it
92 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
96 /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
97 //~^ ERROR: you should put `link_with_underscores` between ticks
98 /// See also [the issue tracker](https://github.com/Manishearth/rust-clippy/search?q=doc_markdown&type=Issues)
99 /// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link].
100 /// It can also be [inline_link2].
101 //~^ ERROR: you should put `inline_link2` between ticks
103 /// [chunked-example]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Example
104 /// [inline_link]: https://foobar
105 /// [inline_link2]: https://foobar
107 /// The `main` function is the entry point of the program. Here it only calls the `foo_bar` and
108 /// `multiline_ticks` functions.
110 /// expression of the type `_ <bit_op> m <cmp_op> c` (where `<bit_op>`
111 /// is one of {`&`, '|'} and `<cmp_op>` is one of {`!=`, `>=`, `>` ,
112 /// be_sure_we_got_to_the_end_of_it
113 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
116 multiline_codeblock();
121 /// ## CamelCaseThing
122 /// Talks about `CamelCaseThing`. Titles should be ignored, see issue #897.
126 /// Not a title #897 CamelCaseThing
127 //~^ ERROR: you should put `CamelCaseThing` between ticks
128 /// be_sure_we_got_to_the_end_of_it
129 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
133 /// I am confused by brackets? (`x_y`)
134 /// I am confused by brackets? (foo `x_y`)
135 /// I am confused by brackets? (`x_y` foo)
136 /// be_sure_we_got_to_the_end_of_it
137 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
141 /// Diesel queries also have a similar problem to [Iterator][iterator], where
143 /// returning them from a function requires exposing the implementation of that
144 /// function. The [`helper_types`][helper_types] module exists to help with this,
145 /// but you might want to hide the return type or have it conditionally change.
146 /// Boxing can achieve both.
148 /// [iterator]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html
149 /// [helper_types]: ../helper_types/index.html
150 /// be_sure_we_got_to_the_end_of_it
151 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
158 /// bar](https://doc.rust-lang.org/stable/std/iter/trait.IteratorFooBar.html)
162 /** E.g. serialization of an empty list: FooBar
164 That's in a code block: `PackedNode`
168 be_sure_we_got_to_the_end_of_it
170 //~^^^^^^^^ ERROR: you should put `FooBar` between ticks
171 //~^^^^ ERROR: you should put `BarQuz` between ticks
172 //~^^^^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
176 /** E.g. serialization of an empty list: FooBar
178 That's in a code block: PackedNode
182 be_sure_we_got_to_the_end_of_it
184 //~^^^^^^^^ ERROR: you should put `FooBar` between ticks
185 //~^^^^ ERROR: you should put `BarQuz` between ticks
186 //~^^^^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
190 /// Test more than three quotes:
196 /// be_sure_we_got_to_the_end_of_it
197 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks