Skip to content

Commit

Permalink
Add test for missing cfg propagation for reexport
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 25, 2022
1 parent 01d64f5 commit 2ed9454
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/test/rustdoc/cfg_doc_reexport.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#![feature(doc_cfg)]
#![feature(no_core)]

#![crate_name = "foo"]
#![no_core]

// @has 'foo/index.html'
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'

#[doc(cfg(feature = "foobar"))]
mod imp_priv {
// @has 'foo/struct.BarPriv.html'
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
// 'Available on crate feature foobar only.'
pub struct BarPriv {}
impl BarPriv {
pub fn test() {}
}
}
#[doc(cfg(feature = "foobar"))]
pub use crate::imp_priv::*;

pub mod bar {
// @has 'foo/bar/struct.Bar.html'
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
// 'Available on crate feature bar only.'
#[doc(cfg(feature = "bar"))]
pub struct Bar;
}

#[doc(cfg(feature = "bar"))]
pub use bar::Bar;

0 comments on commit 2ed9454

Please sign in to comment.