Skip to content

Commit 96f4f4e

Browse files
Add regression test for #94183
1 parent 9876a11 commit 96f4f4e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/94183>.
2+
// This test ensures that a publicly re-exported private trait will
3+
// appear in the blanket impl list.
4+
5+
#![crate_name = "foo"]
6+
7+
// @has 'foo/struct.S.html'
8+
9+
mod actual_sub {
10+
pub trait Actual {}
11+
pub trait Another {}
12+
13+
// `Another` is publicly re-exported so it should appear in the blanket impl list.
14+
// @has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl<T> Another for T'
15+
impl<T> Another for T {}
16+
17+
trait Foo {}
18+
19+
// `Foo` is not publicly re-exported nor reachable so it shouldn't appear in the
20+
// blanket impl list.
21+
// @!has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl<T> Foo for T'
22+
impl<T> Foo for T {}
23+
}
24+
25+
pub use actual_sub::{Actual, Another};
26+
27+
// `Actual` is publicly re-exported so it should appear in the blanket impl list.
28+
// @has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl<T> Actual for T'
29+
impl<T> Actual for T {}
30+
31+
pub struct S;

0 commit comments

Comments
 (0)