diff --git a/src/test/compile-fail/visible-private-types-generics.rs b/src/test/compile-fail/visible-private-types-generics.rs index 397ac5373bb7..7ff18f8e0886 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() {}