|
| 1 | +// This test ensures that `cfg`s are correctly propagated for re-export chains |
| 2 | +// where the outermost is a glob re-export. |
| 3 | + |
| 4 | +#![crate_name = "foo"] |
| 5 | +#![feature(doc_cfg)] |
| 6 | + |
| 7 | +//@ has 'foo/index.html' |
| 8 | +//@ count - '//*[@class="item-table"]/dt' 3 |
| 9 | + |
| 10 | +//@ has 'foo/index.html' |
| 11 | +//@ has - '//dt/a[@title="struct foo::A"]/../*[@class="stab portability"]' 'Non-bar and non-foo' |
| 12 | + |
| 13 | +//@ has 'foo/struct.A.html' |
| 14 | +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ |
| 15 | +// 'Available on non-crate feature bar and non-crate feature foo only.' |
| 16 | + |
| 17 | +mod a { |
| 18 | + mod inner { |
| 19 | + pub struct A {} |
| 20 | + } |
| 21 | + #[cfg(not(feature = "bar"))] |
| 22 | + pub use self::inner::A; |
| 23 | +} |
| 24 | +#[cfg(not(feature = "foo"))] |
| 25 | +pub use a::*; |
| 26 | + |
| 27 | +//@ has 'foo/index.html' |
| 28 | +//@ has - '//dt/a[@title="struct foo::B"]/../*[@class="stab portability"]' 'Non-bar and non-baz and non-foo' |
| 29 | + |
| 30 | +//@ has 'foo/struct.B.html' |
| 31 | +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ |
| 32 | +// 'Available on non-crate feature bar and non-crate feature baz and non-crate feature foo only.' |
| 33 | + |
| 34 | +mod b { |
| 35 | + mod inner { |
| 36 | + mod innermost { |
| 37 | + pub struct B {} |
| 38 | + } |
| 39 | + #[cfg(not(feature = "baz"))] |
| 40 | + pub use self::innermost::B; |
| 41 | + } |
| 42 | + #[cfg(not(feature = "bar"))] |
| 43 | + pub use self::inner::*; |
| 44 | +} |
| 45 | +#[cfg(not(feature = "foo"))] |
| 46 | +pub use b::*; |
| 47 | + |
| 48 | +//@ has 'foo/index.html' |
| 49 | +//@ has - '//dt/a[@title="struct foo::C"]/../*[@class="stab portability"]' 'Non-bar and non-baz and non-foo' |
| 50 | + |
| 51 | +//@ has 'foo/struct.C.html' |
| 52 | +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ |
| 53 | +// 'Available on non-crate feature bar and non-crate feature baz and non-crate feature foo only.' |
| 54 | + |
| 55 | +mod c { |
| 56 | + mod inner { |
| 57 | + mod innermost { |
| 58 | + #[cfg(not(feature = "baz"))] |
| 59 | + pub struct C {} |
| 60 | + } |
| 61 | + pub use self::innermost::*; |
| 62 | + } |
| 63 | + #[cfg(not(feature = "bar"))] |
| 64 | + pub use self::inner::*; |
| 65 | +} |
| 66 | +#[cfg(not(feature = "foo"))] |
| 67 | +pub use c::*; |
0 commit comments