]> git.lizzy.rs Git - rust.git/commitdiff
Add privacy tests
authorSeo Sanghyeon <sanxiyn@gmail.com>
Fri, 19 Dec 2014 07:11:17 +0000 (16:11 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Fri, 19 Dec 2014 07:11:17 +0000 (16:11 +0900)
src/test/compile-fail/visible-private-types-generics.rs

index 397ac5373bb7be0ff41756876f1df50f091af8df..7ff18f8e0886c1d5826a5142228b9b872e610db2 100644 (file)
@@ -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() {}