Skip to content

Commit 68d0094

Browse files
Add regression test for #101129
1 parent fb14ad0 commit 68d0094

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: src/test/rustdoc/doc_auto_cfg_nested_impl.rs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
}

0 commit comments

Comments
 (0)