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