Skip to content

Commit e3b7035

Browse files
Add regression test for rust-lang#81141
1 parent d03b0f5 commit e3b7035

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This test ensures that if a private re-export is present in a public API, it'll be
2+
// replaced by the first public item in the re-export chain or by the private item.
3+
4+
#![crate_name = "foo"]
5+
6+
use crate::bar::Bar as Alias;
7+
8+
pub use crate::bar::Bar as Whatever;
9+
use crate::Whatever as Whatever2;
10+
use crate::Whatever2 as Whatever3;
11+
pub use crate::bar::Inner as Whatever4;
12+
13+
mod bar {
14+
pub struct Bar;
15+
pub use self::Bar as Inner;
16+
}
17+
18+
// @has 'foo/fn.bar.html'
19+
// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar'
20+
pub fn bar() -> Alias {
21+
Alias
22+
}
23+
24+
// @has 'foo/fn.bar2.html'
25+
// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Whatever'
26+
pub fn bar2() -> Whatever3 {
27+
Whatever
28+
}
29+
30+
// @has 'foo/fn.bar3.html'
31+
// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Whatever4'
32+
pub fn bar3() -> Whatever4 {
33+
Whatever
34+
}

0 commit comments

Comments
 (0)