]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/doc.rs
Test previously reported false positive
[rust.git] / tests / compile-fail / doc.rs
1 //! This file tests for the DOC_MARKDOWN lint
2 //~^ ERROR: you should put `DOC_MARKDOWN` between ticks
3
4 #![feature(plugin)]
5 #![plugin(clippy)]
6
7 #![deny(doc_markdown)]
8
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 /// be_sure_we_got_to_the_end_of_it
16 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
17 fn foo_bar() {
18 }
19
20 /// That one tests multiline ticks.
21 /// ```rust
22 /// foo_bar FOO_BAR
23 /// _foo bar_
24 /// ```
25 /// be_sure_we_got_to_the_end_of_it
26 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
27 fn multiline_ticks() {
28 }
29
30 /// This _is a test for
31 /// multiline
32 /// emphasis_.
33 /// be_sure_we_got_to_the_end_of_it
34 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
35 fn test_emphasis() {
36 }
37
38 /// This tests units. See also #835.
39 /// kiB MiB GiB TiB PiB EiB
40 /// kib Mib Gib Tib Pib Eib
41 /// kB MB GB TB PB EB
42 /// kb Mb Gb Tb Pb Eb
43 /// 32kiB 32MiB 32GiB 32TiB 32PiB 32EiB
44 /// 32kib 32Mib 32Gib 32Tib 32Pib 32Eib
45 /// 32kB 32MB 32GB 32TB 32PB 32EB
46 /// 32kb 32Mb 32Gb 32Tb 32Pb 32Eb
47 /// be_sure_we_got_to_the_end_of_it
48 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
49 fn test_units() {
50 }
51
52 /// This one checks we don’t try to split unicode codepoints
53 /// `ß`
54 /// `ℝ`
55 /// `💣`
56 /// `❤️`
57 /// ß_foo
58 //~^ ERROR: you should put `ß_foo` between ticks
59 /// ℝ_foo
60 //~^ ERROR: you should put `ℝ_foo` between ticks
61 /// 💣_foo
62 /// ❤️_foo
63 /// foo_ß
64 //~^ ERROR: you should put `foo_ß` between ticks
65 /// foo_ℝ
66 //~^ ERROR: you should put `foo_ℝ` between ticks
67 /// foo_💣
68 /// foo_❤️
69 /// [ßdummy textß][foo_ß]
70 /// [ℝdummy textℝ][foo_ℝ]
71 /// [💣dummy tex💣t][foo_💣]
72 /// [❤️dummy text❤️][foo_❤️]
73 /// [ßdummy textß](foo_ß)
74 /// [ℝdummy textℝ](foo_ℝ)
75 /// [💣dummy tex💣t](foo_💣)
76 /// [❤️dummy text❤️](foo_❤️)
77 /// [foo_ß]: dummy text
78 /// [foo_ℝ]: dummy text
79 /// [foo_💣]: dummy text
80 /// [foo_❤️]: dummy text
81 /// be_sure_we_got_to_the_end_of_it
82 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
83 fn test_unicode() {
84 }
85
86 /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
87 //~^ ERROR: you should put `link_with_underscores` between ticks
88 /// See also [the issue tracker](https://github.com/Manishearth/rust-clippy/search?q=doc_markdown&type=Issues)
89 /// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link].
90 /// It can also be [inline_link2].
91 //~^ ERROR: you should put `inline_link2` between ticks
92 ///
93 /// [chunked-example]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Example
94 /// [inline_link]: https://foobar
95 /// [inline_link2]: https://foobar
96
97 /// The `main` function is the entry point of the program. Here it only calls the `foo_bar` and
98 /// `multiline_ticks` functions.
99 ///
100 /// expression of the type  `_ <bit_op> m <cmp_op> c` (where `<bit_op>`
101 /// is one of {`&`, '|'} and `<cmp_op>` is one of {`!=`, `>=`, `>` ,
102 /// be_sure_we_got_to_the_end_of_it
103 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
104 fn main() {
105     foo_bar();
106     multiline_ticks();
107     test_emphasis();
108     test_units();
109 }
110
111 /// I am confused by brackets? (`x_y`)
112 /// I am confused by brackets? (foo `x_y`)
113 /// I am confused by brackets? (`x_y` foo)
114 /// be_sure_we_got_to_the_end_of_it
115 //~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
116 fn issue900() {
117 }
118
119 /// Diesel queries also have a similar problem to [Iterator][iterator], where
120 /// /// More talking
121 /// returning them from a function requires exposing the implementation of that
122 /// function. The [`helper_types`][helper_types] module exists to help with this,
123 /// but you might want to hide the return type or have it conditionally change.
124 /// Boxing can achieve both.
125 ///
126 /// [iterator]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html
127 /// [helper_types]: ../helper_types/index.html
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
130 fn issue883() {
131 }