]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/duplicate-cfg.rs
Rollup merge of #82484 - bugadani:docfix, r=jyn514
[rust.git] / src / test / rustdoc / duplicate-cfg.rs
1 // ignore-tidy-linelength
2
3 #![crate_name = "foo"]
4 #![feature(doc_cfg)]
5
6 // @has 'foo/index.html'
7 // @matches '-' '//*[@class="module-item"]//*[@class="stab portability"]' '^sync$'
8 // @has '-' '//*[@class="module-item"]//*[@class="stab portability"]/@title' 'This is supported on crate feature `sync` only'
9
10 // @has 'foo/struct.Foo.html'
11 // @has '-' '//*[@class="stab portability"]' 'sync'
12 #[doc(cfg(feature = "sync"))]
13 #[doc(cfg(feature = "sync"))]
14 pub struct Foo;
15
16 // @has 'foo/bar/index.html'
17 // @has '-' '//*[@class="stab portability"]' 'This is supported on crate feature sync only.'
18 #[doc(cfg(feature = "sync"))]
19 pub mod bar {
20     // @has 'foo/bar/struct.Bar.html'
21     // @has '-' '//*[@class="stab portability"]' 'This is supported on crate feature sync only.'
22     #[doc(cfg(feature = "sync"))]
23     pub struct Bar;
24 }
25
26 // @has 'foo/baz/index.html'
27 // @has '-' '//*[@class="stab portability"]' 'This is supported on crate features sync and send only.'
28 #[doc(cfg(all(feature = "sync", feature = "send")))]
29 pub mod baz {
30     // @has 'foo/baz/struct.Baz.html'
31     // @has '-' '//*[@class="stab portability"]' 'This is supported on crate features sync and send only.'
32     #[doc(cfg(feature = "sync"))]
33     pub struct Baz;
34 }
35
36 // @has 'foo/qux/index.html'
37 // @has '-' '//*[@class="stab portability"]' 'This is supported on crate feature sync only.'
38 #[doc(cfg(feature = "sync"))]
39 pub mod qux {
40     // @has 'foo/qux/struct.Qux.html'
41     // @has '-' '//*[@class="stab portability"]' 'This is supported on crate features sync and send only.'
42     #[doc(cfg(all(feature = "sync", feature = "send")))]
43     pub struct Qux;
44 }
45
46 // @has 'foo/quux/index.html'
47 // @has '-' '//*[@class="stab portability"]' 'This is supported on crate feature sync and crate feature send and foo only.'
48 #[doc(cfg(all(feature = "sync", feature = "send", foo)))]
49 pub mod quux {
50     // @has 'foo/quux/struct.Quux.html'
51     // @has '-' '//*[@class="stab portability"]' 'This is supported on crate feature sync and crate feature send and foo and bar only.'
52     #[doc(cfg(all(feature = "send", feature = "sync", bar)))]
53     pub struct Quux;
54 }