about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs12
-rw-r--r--tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr25
2 files changed, 32 insertions, 5 deletions
diff --git a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs
index 13f3065e442..d5065a6b55b 100644
--- a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs
+++ b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs
@@ -1,5 +1,6 @@
-// We should not emit sealed traits note, see issue #143392
+// We should not emit sealed traits note, see issue #143392 and #143121
 
+/// Reported in #143392
 mod inner {
     pub trait TraitA {}
 
@@ -10,4 +11,13 @@ struct Struct;
 
 impl inner::TraitB for Struct {} //~ ERROR the trait bound `Struct: TraitA` is not satisfied [E0277]
 
+/// Reported in #143121
+mod x {
+    pub trait A {}
+    pub trait B: A {}
+
+    pub struct C;
+    impl B for C {} //~ ERROR the trait bound `C: A` is not satisfied [E0277]
+}
+
 fn main(){}
diff --git a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr
index f80d985ad6e..df8016565da 100644
--- a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr
+++ b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr
@@ -1,20 +1,37 @@
 error[E0277]: the trait bound `Struct: TraitA` is not satisfied
-  --> $DIR/false-sealed-traits-note.rs:11:24
+  --> $DIR/false-sealed-traits-note.rs:12:24
    |
 LL | impl inner::TraitB for Struct {}
    |                        ^^^^^^ the trait `TraitA` is not implemented for `Struct`
    |
 help: this trait has no implementations, consider adding one
-  --> $DIR/false-sealed-traits-note.rs:4:5
+  --> $DIR/false-sealed-traits-note.rs:5:5
    |
 LL |     pub trait TraitA {}
    |     ^^^^^^^^^^^^^^^^
 note: required by a bound in `TraitB`
-  --> $DIR/false-sealed-traits-note.rs:6:23
+  --> $DIR/false-sealed-traits-note.rs:7:23
    |
 LL |     pub trait TraitB: TraitA {}
    |                       ^^^^^^ required by this bound in `TraitB`
 
-error: aborting due to 1 previous error
+error[E0277]: the trait bound `C: A` is not satisfied
+  --> $DIR/false-sealed-traits-note.rs:20:16
+   |
+LL |     impl B for C {}
+   |                ^ the trait `A` is not implemented for `C`
+   |
+help: this trait has no implementations, consider adding one
+  --> $DIR/false-sealed-traits-note.rs:16:5
+   |
+LL |     pub trait A {}
+   |     ^^^^^^^^^^^
+note: required by a bound in `B`
+  --> $DIR/false-sealed-traits-note.rs:17:18
+   |
+LL |     pub trait B: A {}
+   |                  ^ required by this bound in `B`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.