]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/intra-doc/warning.rs
Auto merge of #98186 - mystor:tokenstream_as_vec_tt, r=eddyb
[rust.git] / src / test / rustdoc-ui / intra-doc / warning.rs
1 // check-pass
2
3        //! Test with [Foo::baz], [Bar::foo], ...
4 //~^ WARNING `Foo::baz`
5 //~| WARNING `Bar::foo`
6      //! , [Uniooon::X] and [Qux::Z].
7 //~^ WARNING `Uniooon::X`
8 //~| WARNING `Qux::Z`
9        //!
10       //! , [Uniooon::X] and [Qux::Z].
11 //~^ WARNING `Uniooon::X`
12 //~| WARNING `Qux::Z`
13
14        /// [Qux:Y]
15 //~^ WARNING `Qux:Y`
16 pub struct Foo {
17     pub bar: usize,
18 }
19
20 /// Foo
21 /// bar [BarA] bar //~ WARNING `BarA`
22 /// baz
23 pub fn a() {}
24
25 /**
26  * Foo
27  * bar [BarB] bar //~ WARNING `BarB`
28  * baz
29  */
30 pub fn b() {}
31
32 /** Foo
33
34 bar [BarC] bar //~ WARNING `BarC`
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`
46 pub fn d() {}
47
48 macro_rules! f {
49     ($f:expr) => {
50         #[doc = $f] //~ WARNING `BarF`
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`
59 pub struct A;
60
61 /**
62  * # for example,
63  *
64  * time to introduce a link [error] //~ WARNING `error`
65  */
66 pub struct B;
67
68 #[doc = "single line [error]"] //~ WARNING `error`
69 pub struct C;
70
71 #[doc = "single line with \"escaping\" [error]"] //~ WARNING `error`
72 pub struct D;
73
74 /// Item docs. //~ WARNING `error`
75 #[doc="Hello there!"]
76 /// [error]
77 pub struct E;
78
79 ///
80 /// docs [error1] //~ WARNING `error1`
81
82 /// docs [error2] //~ WARNING `error2`
83 ///
84 pub struct F;