]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/url-improvements.rs
Rollup merge of #84014 - estebank:cool-bears-hot-tip, r=varkor
[rust.git] / src / test / rustdoc-ui / url-improvements.rs
1 #![deny(rustdoc::bare_urls)]
2
3 /// https://somewhere.com
4 //~^ ERROR this URL is not a hyperlink
5 /// https://somewhere.com/a
6 //~^ ERROR this URL is not a hyperlink
7 /// https://www.somewhere.com
8 //~^ ERROR this URL is not a hyperlink
9 /// https://www.somewhere.com/a
10 //~^ ERROR this URL is not a hyperlink
11 /// https://subdomain.example.com
12 //~^ ERROR not a hyperlink
13 /// https://somewhere.com?
14 //~^ ERROR this URL is not a hyperlink
15 /// https://somewhere.com/a?
16 //~^ ERROR this URL is not a hyperlink
17 /// https://somewhere.com?hello=12
18 //~^ ERROR this URL is not a hyperlink
19 /// https://somewhere.com/a?hello=12
20 //~^ ERROR this URL is not a hyperlink
21 /// https://example.com?hello=12#xyz
22 //~^ ERROR this URL is not a hyperlink
23 /// https://example.com/a?hello=12#xyz
24 //~^ ERROR this URL is not a hyperlink
25 /// https://example.com#xyz
26 //~^ ERROR this URL is not a hyperlink
27 /// https://example.com/a#xyz
28 //~^ ERROR this URL is not a hyperlink
29 /// https://somewhere.com?hello=12&bye=11
30 //~^ ERROR this URL is not a hyperlink
31 /// https://somewhere.com/a?hello=12&bye=11
32 //~^ ERROR this URL is not a hyperlink
33 /// https://somewhere.com?hello=12&bye=11#xyz
34 //~^ ERROR this URL is not a hyperlink
35 /// hey! https://somewhere.com/a?hello=12&bye=11#xyz
36 //~^ ERROR this URL is not a hyperlink
37 pub fn c() {}
38
39 /// <https://somewhere.com>
40 /// [a](http://a.com)
41 /// [b]
42 ///
43 /// [b]: http://b.com
44 ///
45 /// ```
46 /// This link should not be linted: http://example.com
47 ///
48 /// Nor this one: <http://example.com> or this one: [x](http://example.com)
49 /// ```
50 ///
51 /// [should_not.lint](should_not.lint)
52 pub fn everything_is_fine_here() {}
53
54 #[allow(rustdoc::bare_urls)]
55 pub mod foo {
56     /// https://somewhere.com/a?hello=12&bye=11#xyz
57     pub fn bar() {}
58 }