]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/doc_auto_cfg_nested_impl.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / rustdoc / doc_auto_cfg_nested_impl.rs
1 // Regression test for <https://github.com/rust-lang/rust/issues/101129>.
2
3 #![feature(doc_auto_cfg)]
4 #![crate_type = "lib"]
5 #![crate_name = "foo"]
6
7 pub struct S;
8 pub trait MyTrait1 {}
9 pub trait MyTrait2 {}
10
11 // @has foo/struct.S.html
12 // @has - '//*[@id="impl-MyTrait1-for-S"]//*[@class="stab portability"]' \
13 //        'Available on non-crate feature coolstuff only.'
14 #[cfg(not(feature = "coolstuff"))]
15 impl MyTrait1 for S {}
16
17 #[cfg(not(feature = "coolstuff"))]
18 mod submod {
19     use crate::{S, MyTrait2};
20     // This impl should also have the `not(feature = "coolstuff")`.
21     // @has - '//*[@id="impl-MyTrait2-for-S"]//*[@class="stab portability"]' \
22     //        'Available on non-crate feature coolstuff only.'
23     impl MyTrait2 for S {}
24 }