summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/sealed-traits/sealed-trait-local.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/privacy/sealed-traits/sealed-trait-local.rs40
1 files changed, 38 insertions, 2 deletions
diff --git a/tests/ui/privacy/sealed-traits/sealed-trait-local.rs b/tests/ui/privacy/sealed-traits/sealed-trait-local.rs
index 778ddf0f8..9ae01259a 100644
--- a/tests/ui/privacy/sealed-traits/sealed-trait-local.rs
+++ b/tests/ui/privacy/sealed-traits/sealed-trait-local.rs
@@ -13,7 +13,43 @@ pub mod a {
}
}
-struct S;
-impl a::Sealed for S {} //~ ERROR the trait bound `S: Hidden` is not satisfied
+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() {}