]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/duplicate-cfg.rs
Remove astconv usage in diagnostic
[rust.git] / tests / rustdoc / duplicate-cfg.rs
1 #![crate_name = "foo"]
2 #![feature(doc_cfg)]
3
4 // @has 'foo/index.html'
5 // @matches '-' '//*[@class="item-left"]//*[@class="stab portability"]' '^sync$'
6 // @has '-' '//*[@class="item-left"]//*[@class="stab portability"]/@title' 'Available 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 /// my feature sync struct
13 pub struct Foo;
14
15 // @has 'foo/bar/index.html'
16 // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.'
17 #[doc(cfg(feature = "sync"))]
18 pub mod bar {
19     // @has 'foo/bar/struct.Bar.html'
20     // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.'
21     #[doc(cfg(feature = "sync"))]
22     pub struct Bar;
23 }
24
25 // @has 'foo/baz/index.html'
26 // @has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.'
27 #[doc(cfg(all(feature = "sync", feature = "send")))]
28 pub mod baz {
29     // @has 'foo/baz/struct.Baz.html'
30     // @has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.'
31     #[doc(cfg(feature = "sync"))]
32     pub struct Baz;
33 }
34
35 // @has 'foo/qux/index.html'
36 // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.'
37 #[doc(cfg(feature = "sync"))]
38 pub mod qux {
39     // @has 'foo/qux/struct.Qux.html'
40     // @has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.'
41     #[doc(cfg(all(feature = "sync", feature = "send")))]
42     pub struct Qux;
43 }
44
45 // @has 'foo/quux/index.html'
46 // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync and crate feature send and foo only.'
47 #[doc(cfg(all(feature = "sync", feature = "send", foo)))]
48 pub mod quux {
49     // @has 'foo/quux/struct.Quux.html'
50     // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync and crate feature send and foo and bar only.'
51     #[doc(cfg(all(feature = "send", feature = "sync", bar)))]
52     pub struct Quux;
53 }