]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/automatic-links.rs
Fix automatic_links warnings
[rust.git] / src / test / rustdoc-ui / automatic-links.rs
1 #![deny(automatic_links)]
2
3 /// [http://a.com](http://a.com)
4 //~^ ERROR unneeded long form for URL
5 /// [http://b.com]
6 //~^ ERROR unneeded long form for URL
7 ///
8 /// [http://b.com]: http://b.com
9 ///
10 /// [http://c.com][http://c.com]
11 pub fn a() {}
12
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://www.somewhere.com
18 //~^ ERROR this URL is not a hyperlink
19 /// https://www.somewhere.com/a
20 //~^ ERROR this URL is not a hyperlink
21 /// https://subdomain.example.com
22 //~^ ERROR not a hyperlink
23 /// https://somewhere.com?
24 //~^ ERROR this URL is not a hyperlink
25 /// https://somewhere.com/a?
26 //~^ ERROR this URL is not a hyperlink
27 /// https://somewhere.com?hello=12
28 //~^ ERROR this URL is not a hyperlink
29 /// https://somewhere.com/a?hello=12
30 //~^ ERROR this URL is not a hyperlink
31 /// https://example.com?hello=12#xyz
32 //~^ ERROR this URL is not a hyperlink
33 /// https://example.com/a?hello=12#xyz
34 //~^ ERROR this URL is not a hyperlink
35 /// https://example.com#xyz
36 //~^ ERROR this URL is not a hyperlink
37 /// https://example.com/a#xyz
38 //~^ ERROR this URL is not a hyperlink
39 /// https://somewhere.com?hello=12&bye=11
40 //~^ ERROR this URL is not a hyperlink
41 /// https://somewhere.com/a?hello=12&bye=11
42 //~^ ERROR this URL is not a hyperlink
43 /// https://somewhere.com?hello=12&bye=11#xyz
44 //~^ ERROR this URL is not a hyperlink
45 /// hey! https://somewhere.com/a?hello=12&bye=11#xyz
46 //~^ ERROR this URL is not a hyperlink
47 pub fn c() {}
48
49 /// <https://somewhere.com>
50 /// [a](http://a.com)
51 /// [b]
52 ///
53 /// [b]: http://b.com
54 pub fn everything_is_fine_here() {}
55
56 #[allow(automatic_links)]
57 pub mod foo {
58     /// https://somewhere.com/a?hello=12&bye=11#xyz
59     pub fn bar() {}
60 }