]> git.proxmox.com Git - rustc.git/blob - src/test/rustdoc-ui/intra-links-warning.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / rustdoc-ui / intra-links-warning.rs
1 // build-pass
2
3 //! Test with [Foo::baz], [Bar::foo], ...
4 //~^ WARNING `[Foo::baz]` cannot be resolved
5 //~| WARNING `[Bar::foo]` cannot be resolved
6 //! , [Uniooon::X] and [Qux::Z].
7 //~^ WARNING `[Uniooon::X]` cannot be resolved
8 //~| WARNING `[Qux::Z]` cannot be resolved
9 //!
10 //! , [Uniooon::X] and [Qux::Z].
11 //~^ WARNING `[Uniooon::X]` cannot be resolved
12 //~| WARNING `[Qux::Z]` cannot be resolved
13
14 /// [Qux:Y]
15 //~^ WARNING `[Qux:Y]` cannot be resolved
16 pub struct Foo {
17 pub bar: usize,
18 }
19
20 /// Foo
21 /// bar [BarA] bar //~ WARNING `[BarA]` cannot be resolved
22 /// baz
23 pub fn a() {}
24
25 /**
26 * Foo
27 * bar [BarB] bar //~ WARNING `[BarB]` cannot be resolved
28 * baz
29 */
30 pub fn b() {}
31
32 /** Foo
33
34 bar [BarC] bar //~ WARNING `[BarC]` cannot be resolved
35 baz
36
37 let bar_c_1 = 0;
38 let bar_c_2 = 0;
39 let g = [bar_c_1];
40 let h = g[bar_c_2];
41
42 */
43 pub fn c() {}
44
45 #[doc = "Foo\nbar [BarD] bar\nbaz"] //~ WARNING `[BarD]` cannot be resolved
46 pub fn d() {}
47
48 macro_rules! f {
49 ($f:expr) => {
50 #[doc = $f] //~ WARNING `[BarF]` cannot be resolved
51 pub fn f() {}
52 }
53 }
54 f!("Foo\nbar [BarF] bar\nbaz");
55
56 /** # for example,
57 *
58 * time to introduce a link [error]*/ //~ WARNING `[error]` cannot be resolved
59 pub struct A;
60
61 /**
62 * # for example,
63 *
64 * time to introduce a link [error] //~ WARNING `[error]` cannot be resolved
65 */
66 pub struct B;
67
68 #[doc = "single line [error]"] //~ WARNING `[error]` cannot be resolved
69 pub struct C;
70
71 #[doc = "single line with \"escaping\" [error]"] //~ WARNING `[error]` cannot be resolved
72 pub struct D;
73
74 /// Item docs. //~ WARNING `[error]` cannot be resolved
75 #[doc="Hello there!"]
76 /// [error]
77 pub struct E;
78
79 ///
80 /// docs [error1] //~ WARNING `[error1]` cannot be resolved
81
82 /// docs [error2] //~ WARNING `[error2]` cannot be resolved
83 ///
84 pub struct F;