]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/visible-private-types-generics.rs
Auto merge of #22541 - Manishearth:rollup, r=Gankro
[rust.git] / src / test / compile-fail / visible-private-types-generics.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 trait Foo {
12     fn dummy(&self) { }
13 }
14
15 pub fn f<
16     T
17     : Foo //~ ERROR private trait in exported type parameter bound
18 >() {}
19
20 pub fn g<T>() where
21     T
22     : Foo //~ ERROR private trait in exported type parameter bound
23 {}
24
25 pub struct S;
26
27 impl S {
28     pub fn f<
29         T
30         : Foo //~ ERROR private trait in exported type parameter bound
31     >() {}
32
33     pub fn g<T>() where
34         T
35         : Foo //~ ERROR private trait in exported type parameter bound
36     {}
37 }
38
39 pub struct S1<
40     T
41     : Foo //~ ERROR private trait in exported type parameter bound
42 > {
43     x: T
44 }
45
46 pub struct S2<T> where
47     T
48     : Foo //~ ERROR private trait in exported type parameter bound
49 {
50     x: T
51 }
52
53 pub enum E1<
54     T
55     : Foo //~ ERROR private trait in exported type parameter bound
56 > {
57     V1(T)
58 }
59
60 pub enum E2<T> where
61     T
62     : Foo //~ ERROR private trait in exported type parameter bound
63 {
64     V2(T)
65 }
66
67 fn main() {}