Skip to content

Commit 8de4308

Browse files
Add regression test for rust-lang#111064
1 parent cbc6daa commit 8de4308

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
#![crate_name = "foo"]
4+
5+
// @!has 'foo/hidden/index.html'
6+
// FIXME: add missing `@` for the two next tests once issue is fixed!
7+
// To be done in <https://github.com/rust-lang/rust/issues/111249>.
8+
// !has 'foo/hidden/inner/index.html'
9+
// !has 'foo/hidden/inner/trait.Foo.html'
10+
#[doc(hidden)]
11+
pub mod hidden {
12+
pub mod inner {
13+
pub trait Foo {
14+
/// Hello, world!
15+
fn test();
16+
}
17+
}
18+
}
19+
20+
// @has 'foo/visible/index.html'
21+
// @has 'foo/visible/trait.Foo.html'
22+
#[doc(inline)]
23+
pub use hidden::inner as visible;
24+
25+
// @has 'foo/struct.Bar.html'
26+
// @count - '//*[@id="impl-Foo-for-Bar"]' 1
27+
pub struct Bar;
28+
29+
impl visible::Foo for Bar {
30+
fn test() {}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/111064>.
2+
// Methods from a re-exported trait inside a `#[doc(hidden)]` item should
3+
// be visible.
4+
5+
#![crate_name = "foo"]
6+
7+
// @has 'foo/index.html'
8+
// @has - '//*[@id="main-content"]//*[@class="item-name"]/a[@href="trait.Foo.html"]' 'Foo'
9+
10+
// @has 'foo/trait.Foo.html'
11+
// @has - '//*[@id="main-content"]//*[@class="code-header"]' 'fn test()'
12+
13+
#[doc(hidden)]
14+
mod hidden {
15+
pub trait Foo {
16+
/// Hello, world!
17+
fn test();
18+
}
19+
}
20+
21+
pub use hidden::Foo;

0 commit comments

Comments
 (0)