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