rust/tests/ui/privacy/sealed-traits/sealed-trait-local.rs

20 lines
355 B
Rust
Raw Normal View History

// 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 {}
}
}
struct S;
impl a::Sealed for S {} //~ ERROR the trait bound `S: Hidden` is not satisfied
fn main() {}