Skip to content

Commit 5c70287

Browse files
Add regression test for #60522
1 parent 21fab43 commit 5c70287

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/60522>.
2+
// This test ensures that the `banana` and `peach` modules don't appear twice
3+
// and that the visible modules are not the re-exported ones.
4+
5+
#![crate_name = "foo"]
6+
7+
// @has 'foo/index.html'
8+
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
9+
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Modules'
10+
// @count - '//*[@id="main-content"]/*[@class="item-table"]//*[@class="mod"]' 2
11+
// @has - '//*[@id="main-content"]//*[@class="mod"]' 'banana'
12+
// @has - '//*[@id="main-content"]//*[@href="banana/index.html"]' 'banana'
13+
// @has - '//*[@id="main-content"]//*[@class="mod"]' 'peach'
14+
// @has - '//*[@id="main-content"]//*[@href="peach/index.html"]' 'peach'
15+
16+
pub use crate::my_crate::*;
17+
18+
mod my_crate {
19+
pub mod banana {
20+
pub struct Yellow;
21+
}
22+
pub mod peach {
23+
pub struct Pink;
24+
}
25+
}
26+
27+
// @has 'foo/banana/index.html'
28+
// @count - '//*[@id="main-content"]//*[@class="struct"]' 1
29+
// @has - '//*[@id="main-content"]//*[@class="struct"]' 'Brown'
30+
pub mod banana {
31+
pub struct Brown;
32+
}
33+
34+
// @has 'foo/peach/index.html'
35+
// @count - '//*[@id="main-content"]//*[@class="struct"]' 1
36+
// @has - '//*[@id="main-content"]//*[@class="struct"]' 'Pungent'
37+
pub mod peach {
38+
pub struct Pungent;
39+
}

0 commit comments

Comments
 (0)