blob: 9ae01259a78104437b3495b88c3eeab6feb19d39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// provide custom privacy error for sealed traits
pub mod a {
pub trait Sealed: self::b::Hidden {
fn foo() {}
}
struct X;
impl Sealed for X {}
impl self::b::Hidden for X {}
mod b {
pub trait Hidden {}
}
}
pub mod c {
pub trait Sealed: self::d::Hidden {
fn foo() {}
}
struct X;
impl Sealed for X {}
impl self::d::Hidden for X {}
struct Y;
impl Sealed for Y {}
impl self::d::Hidden for Y {}
mod d {
pub trait Hidden {}
}
}
pub mod e {
pub trait Sealed: self::f::Hidden {
fn foo() {}
}
struct X;
impl self::f::Hidden for X {}
struct Y;
impl self::f::Hidden for Y {}
impl<T: self::f::Hidden> Sealed for T {}
mod f {
pub trait Hidden {}
}
}
struct S;
impl a::Sealed for S {} //~ ERROR the trait bound
impl c::Sealed for S {} //~ ERROR the trait bound
impl e::Sealed for S {} //~ ERROR the trait bound
fn main() {}
|