2024-01-30 17:14:09 +00:00
|
|
|
// This test ensures that non-glob reexports don't get their attributes merge with
|
|
|
|
// the reexported item whereas glob reexports do.
|
|
|
|
// Regression test for <https://github.com/rust-lang/rust/issues/120487>.
|
|
|
|
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
#![feature(doc_cfg)]
|
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/index.html'
|
2024-01-30 17:14:09 +00:00
|
|
|
// There are two items.
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ count - '//*[@class="item-table"]//div[@class="item-name"]' 2
|
2024-01-30 17:14:09 +00:00
|
|
|
// Only one of them should have an attribute.
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ count - '//*[@class="item-table"]//div[@class="item-name"]/*[@class="stab portability"]' 1
|
2024-01-30 17:14:09 +00:00
|
|
|
|
|
|
|
mod a {
|
|
|
|
#[doc(cfg(not(feature = "a")))]
|
|
|
|
#[cfg(not(feature = "a"))]
|
|
|
|
pub struct Test1;
|
|
|
|
}
|
|
|
|
|
|
|
|
mod b {
|
|
|
|
#[doc(cfg(not(feature = "a")))]
|
|
|
|
#[cfg(not(feature = "a"))]
|
|
|
|
pub struct Test2;
|
|
|
|
}
|
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/struct.Test1.html'
|
|
|
|
//@ count - '//*[@id="main-content"]/*[@class="item-info"]' 1
|
|
|
|
//@ has - '//*[@id="main-content"]/*[@class="item-info"]' 'Available on non-crate feature a only.'
|
2024-01-30 17:14:09 +00:00
|
|
|
pub use a::*;
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has 'foo/struct.Test2.html'
|
|
|
|
//@ count - '//*[@id="main-content"]/*[@class="item-info"]' 0
|
2024-01-30 17:14:09 +00:00
|
|
|
pub use b::Test2;
|