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.
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.
11 #![feature(struct_variant)]
12 #![deny(visible_private_types)]
19 impl Private<Public<int>> {
20 pub fn a(&self) -> Private<int> { fail!() }
21 fn b(&self) -> Private<int> { fail!() }
23 pub fn c() -> Private<int> { fail!() }
24 fn d() -> Private<int> { fail!() }
27 pub fn e(&self) -> Private<int> { fail!() }
28 fn f(&self) -> Private<int> { fail!() }
31 impl Public<Private<int>> {
32 pub fn a(&self) -> Private<int> { fail!() }
33 fn b(&self) -> Private<int> { fail!() }
35 pub fn c() -> Private<int> { fail!() } //~ ERROR private type in exported type signature
36 fn d() -> Private<int> { fail!() }
39 pub fn e(&self) -> Private<int> { fail!() } //~ ERROR private type in exported type signature
40 fn f(&self) -> Private<int> { fail!() }
43 pub fn x(_: Private<int>) {} //~ ERROR private type in exported type signature
45 fn y(_: Private<int>) {}
49 x: Private<int>, //~ ERROR private type in exported type signature
58 Baz1(Private<int>), //~ ERROR private type in exported type signature
60 x: Private<int>, //~ ERROR private type in exported type signature
64 priv Baz3(Private<int>),
78 fn foo(&self) -> Private<int> { fail!( )} //~ ERROR private type in exported type signature
79 fn bar(&self) -> Private<int>; //~ ERROR private type in exported type signature
80 fn baz() -> Private<int>; //~ ERROR private type in exported type signature
83 impl PubTrait for Public<int> {
84 fn bar(&self) -> Private<int> { fail!() }
85 fn baz() -> Private<int> { fail!() }
87 impl PubTrait for Public<Private<int>> {
88 fn bar(&self) -> Private<int> { fail!() }
89 fn baz() -> Private<int> { fail!() }
92 impl PubTrait for Private<int> {
93 fn bar(&self) -> Private<int> { fail!() }
94 fn baz() -> Private<int> { fail!() }
96 impl PubTrait for (Private<int>,) {
97 fn bar(&self) -> Private<int> { fail!() }
98 fn baz() -> Private<int> { fail!() }
103 fn foo(&self) -> Private<int> { fail!( )}
104 fn bar(&self) -> Private<int>;
106 impl PrivTrait for Private<int> {
107 fn bar(&self) -> Private<int> { fail!() }
109 impl PrivTrait for (Private<int>,) {
110 fn bar(&self) -> Private<int> { fail!() }
113 pub trait ParamTrait<T> {
117 impl ParamTrait<Private<int>> //~ ERROR private type in exported type signature
119 fn foo() -> Private<int> { fail!() }
122 impl ParamTrait<Private<int>> for Private<int> {
123 fn foo() -> Private<int> { fail!( )}
126 impl<T: ParamTrait<Private<int>>> //~ ERROR private type in exported type signature
127 ParamTrait<T> for Public<i8> {
128 fn foo() -> T { fail!() }