From 2800695fb064a9fcc10ecc21fee175c24d145030 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 19 Dec 2014 16:11:17 +0900 Subject: [PATCH] Add privacy tests --- .../visible-private-types-generics.rs | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) 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() 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() 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 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 where + T + : Foo //~ ERROR private trait in exported type parameter bound +{ + V2(T) +} + fn main() {}