Skip to content

Commit 9b788da

Browse files
Update rustdoc anonymous reexport test and add regression test for #108931
1 parent e8bd4ef commit 9b788da

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

tests/rustdoc/anonymous-reexport.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
// @has 'foo/index.html'
66
// @has - '//*[@id="main-content"]' ''
7-
// We check that the only "h2" present is for "Bla".
8-
// @count - '//*[@id="main-content"]/h2' 1
7+
// We check that the only "h2" present are "Structs" (for "Bla") and "Re-exports".
8+
// @count - '//*[@id="main-content"]/h2' 2
99
// @has - '//*[@id="main-content"]/h2' 'Structs'
10+
// @has - '//*[@id="main-content"]/h2' 'Re-exports'
11+
// The 3 re-exports.
12+
// @count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3
13+
// The public struct.
1014
// @count - '//*[@id="main-content"]//a[@class="struct"]' 1
1115

1216
mod ext {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Ensuring that anonymous re-exports are always inlined.
2+
3+
#![crate_name = "foo"]
4+
5+
pub mod foo {
6+
pub struct Foo;
7+
}
8+
9+
mod bar {
10+
pub struct Bar;
11+
}
12+
13+
// @has 'foo/index.html'
14+
// We check that the only "h2" present are "Re-exports" and "Modules".
15+
// @count - '//*[@id="main-content"]/h2' 2
16+
// @has - '//*[@id="main-content"]/h2' 'Re-exports'
17+
// @has - '//*[@id="main-content"]/h2' 'Modules'
18+
// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use foo::Foo as _;'
19+
// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use bar::Bar as _;'
20+
pub use foo::Foo as _;
21+
pub use bar::Bar as _;

0 commit comments

Comments
 (0)