]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/visible-private-types-generics.rs
Auto merge of #22517 - brson:relnotes, 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
13 pub fn f<
14     T
15     : Foo //~ ERROR private trait in exported type parameter bound
16 >() {}
17
18 pub fn g<T>() where
19     T
20     : Foo //~ ERROR private trait in exported type parameter bound
21 {}
22
23 pub struct S;
24
25 impl S {
26     pub fn f<
27         T
28         : Foo //~ ERROR private trait in exported type parameter bound
29     >() {}
30
31     pub fn g<T>() where
32         T
33         : Foo //~ ERROR private trait in exported type parameter bound
34     {}
35 }
36
37 pub struct S1<
38     T
39     : Foo //~ ERROR private trait in exported type parameter bound
40 > {
41     x: T
42 }
43
44 pub struct S2<T> where
45     T
46     : Foo //~ ERROR private trait in exported type parameter bound
47 {
48     x: T
49 }
50
51 pub enum E1<
52     T
53     : Foo //~ ERROR private trait in exported type parameter bound
54 > {
55     V1(T)
56 }
57
58 pub enum E2<T> where
59     T
60     : Foo //~ ERROR private trait in exported type parameter bound
61 {
62     V2(T)
63 }
64
65 fn main() {}