about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2014-12-19 16:11:17 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2014-12-19 16:11:17 +0900
commit2800695fb064a9fcc10ecc21fee175c24d145030 (patch)
tree438e363b35a5fcc4c8e2969281fe49b67b810510 /src
parent3e0cdb63391af29ef83050f1b08a4232911f81f3 (diff)
downloadrust-2800695fb064a9fcc10ecc21fee175c24d145030.tar.gz
rust-2800695fb064a9fcc10ecc21fee175c24d145030.zip
Add privacy tests
Diffstat (limited to 'src')
-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() {}