]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/duplicate-cfg.rs
Auto merge of #75775 - matklad:rustc-lexer-rustdoc-highlight, r=GuillaumeGomez
[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 // @matches '-' '//*[@class="module-item"]//*[@class="stab portability"]' '^sync$'
18 // @has '-' '//*[@class="module-item"]//*[@class="stab portability"]/@title' 'This is supported on crate feature `sync` only'
19
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 mod bar {
24     #[doc(cfg(feature = "sync"))]
25     pub struct Bar;
26 }
27
28 // @has 'foo/baz/index.html'
29 // @matches '-' '//*[@class="module-item"]//*[@class="stab portability"]' '^sync and send$'
30 // @has '-' '//*[@class="module-item"]//*[@class="stab portability"]/@title' 'This is supported on crate features `sync` and `send` only'
31
32 // @has 'foo/baz/struct.Baz.html'
33 // @has '-' '//*[@class="stab portability"]' 'This is supported on crate features sync and send only.'
34 #[doc(cfg(all(feature = "sync", feature = "send")))]
35 pub mod baz {
36     #[doc(cfg(feature = "sync"))]
37     pub struct Baz;
38 }
39
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(feature = "sync"))]
43 pub mod qux {
44     #[doc(cfg(all(feature = "sync", feature = "send")))]
45     pub struct Qux;
46 }
47
48 // @has 'foo/quux/index.html'
49 // @matches '-' '//*[@class="module-item"]//*[@class="stab portability"]' '^sync and send and foo and bar$'
50 // @has '-' '//*[@class="module-item"]//*[@class="stab portability"]/@title' 'This is supported on crate feature `sync` and crate feature `send` and `foo` and `bar` only'
51
52 // @has 'foo/quux/struct.Quux.html'
53 // @has '-' '//*[@class="stab portability"]' 'This is supported on crate feature sync and crate feature send and foo and bar only.'
54 #[doc(cfg(all(feature = "sync", feature = "send", foo)))]
55 pub mod quux {
56     #[doc(cfg(all(feature = "send", feature = "sync", bar)))]
57     pub struct Quux;
58 }