Skip to content

Commit 2800695

Browse files
committed
Add privacy tests
1 parent 3e0cdb6 commit 2800695

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/test/compile-fail/visible-private-types-generics.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,46 @@ pub fn g<T>() where
2020
: Foo //~ ERROR private trait in exported type parameter bound
2121
{}
2222

23+
pub struct S;
24+
25+
impl S {
26+
pub fn f<
27+
T
28+
: Foo //~ ERROR private trait in exported type parameter bound
29+
>() {}
30+
31+
pub fn g<T>() where
32+
T
33+
: Foo //~ ERROR private trait in exported type parameter bound
34+
{}
35+
}
36+
37+
pub struct S1<
38+
T
39+
: Foo //~ ERROR private trait in exported type parameter bound
40+
> {
41+
x: T
42+
}
43+
44+
pub struct S2<T> where
45+
T
46+
: Foo //~ ERROR private trait in exported type parameter bound
47+
{
48+
x: T
49+
}
50+
51+
pub enum E1<
52+
T
53+
: Foo //~ ERROR private trait in exported type parameter bound
54+
> {
55+
V1(T)
56+
}
57+
58+
pub enum E2<T> where
59+
T
60+
: Foo //~ ERROR private trait in exported type parameter bound
61+
{
62+
V2(T)
63+
}
64+
2365
fn main() {}

0 commit comments

Comments
 (0)