summaryrefslogtreecommitdiff
path: root/tests/ui/impl-trait/in-assoc-type.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/in-assoc-type.stderr')
-rw-r--r--tests/ui/impl-trait/in-assoc-type.stderr22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-assoc-type.stderr b/tests/ui/impl-trait/in-assoc-type.stderr
new file mode 100644
index 00000000000..f0a272dc2d5
--- /dev/null
+++ b/tests/ui/impl-trait/in-assoc-type.stderr
@@ -0,0 +1,22 @@
+error[E0308]: mismatched types
+ --> $DIR/in-assoc-type.rs:17:22
+ |
+LL | type Bar = impl std::fmt::Debug;
+ | -------------------- the expected opaque type
+...
+LL | fn foo(&self) -> <Self as Foo<()>>::Bar {}
+ | --- ^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found `()`
+ | |
+ | implicitly returns `()` as its body has no tail or `return` expression
+ |
+ = note: expected opaque type `<() as Foo<()>>::Bar`
+ found unit type `()`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/in-assoc-type.rs:17:5
+ |
+LL | fn foo(&self) -> <Self as Foo<()>>::Bar {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.