about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/wf/wf-complex-assoc-type.rs12
-rw-r--r--src/test/ui/wf/wf-complex-assoc-type.stderr12
-rw-r--r--src/test/ui/wf/wf-impl-associated-type-trait.stderr4
3 files changed, 26 insertions, 2 deletions
diff --git a/src/test/ui/wf/wf-complex-assoc-type.rs b/src/test/ui/wf/wf-complex-assoc-type.rs
new file mode 100644
index 00000000000..c3811e82394
--- /dev/null
+++ b/src/test/ui/wf/wf-complex-assoc-type.rs
@@ -0,0 +1,12 @@
+trait MyTrait {}
+struct AssertMyTrait<T: MyTrait>(T);
+
+trait HelperTrait {
+    type MyItem;
+}
+
+impl HelperTrait for () {
+    type MyItem = Option<((AssertMyTrait<bool>, u8))>; //~ ERROR the trait bound
+}
+
+fn main() {}
diff --git a/src/test/ui/wf/wf-complex-assoc-type.stderr b/src/test/ui/wf/wf-complex-assoc-type.stderr
new file mode 100644
index 00000000000..c366519a8d7
--- /dev/null
+++ b/src/test/ui/wf/wf-complex-assoc-type.stderr
@@ -0,0 +1,12 @@
+error[E0277]: the trait bound `bool: MyTrait` is not satisfied
+  --> $DIR/wf-complex-assoc-type.rs:9:28
+   |
+LL | struct AssertMyTrait<T: MyTrait>(T);
+   |                         ------- required by this bound in `AssertMyTrait`
+...
+LL |     type MyItem = Option<((AssertMyTrait<bool>, u8))>;
+   |                            ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `bool`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-impl-associated-type-trait.stderr b/src/test/ui/wf/wf-impl-associated-type-trait.stderr
index 89399e30cad..0d4480fbf26 100644
--- a/src/test/ui/wf/wf-impl-associated-type-trait.stderr
+++ b/src/test/ui/wf/wf-impl-associated-type-trait.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `T: MyHash` is not satisfied
-  --> $DIR/wf-impl-associated-type-trait.rs:17:5
+  --> $DIR/wf-impl-associated-type-trait.rs:17:16
    |
 LL | pub struct MySet<T:MyHash> {
    |                    ------ required by this bound in `MySet`
 ...
 LL |     type Bar = MySet<T>;
-   |     ^^^^^^^^^^^^^^^^^^^^ the trait `MyHash` is not implemented for `T`
+   |                ^^^^^^^^ the trait `MyHash` is not implemented for `T`
    |
 help: consider restricting type parameter `T`
    |