about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/compile-fail/visible-private-types-generics.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/compile-fail/visible-private-types-generics.rs b/src/test/compile-fail/visible-private-types-generics.rs
index 397ac5373bb..7ff18f8e088 100644
--- a/src/test/compile-fail/visible-private-types-generics.rs
+++ b/src/test/compile-fail/visible-private-types-generics.rs
@@ -20,4 +20,46 @@ pub fn g<T>() where
     : Foo //~ ERROR private trait in exported type parameter bound
 {}
 
+pub struct S;
+
+impl S {
+    pub fn f<
+        T
+        : Foo //~ ERROR private trait in exported type parameter bound
+    >() {}
+
+    pub fn g<T>() where
+        T
+        : Foo //~ ERROR private trait in exported type parameter bound
+    {}
+}
+
+pub struct S1<
+    T
+    : Foo //~ ERROR private trait in exported type parameter bound
+> {
+    x: T
+}
+
+pub struct S2<T> where
+    T
+    : Foo //~ ERROR private trait in exported type parameter bound
+{
+    x: T
+}
+
+pub enum E1<
+    T
+    : Foo //~ ERROR private trait in exported type parameter bound
+> {
+    V1(T)
+}
+
+pub enum E2<T> where
+    T
+    : Foo //~ ERROR private trait in exported type parameter bound
+{
+    V2(T)
+}
+
 fn main() {}