summaryrefslogtreecommitdiff
path: root/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr')
-rw-r--r--tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr b/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr
new file mode 100644
index 00000000000..2beed73cb85
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr
@@ -0,0 +1,22 @@
+error[E0308]: mismatched types
+ --> $DIR/invalid_impl_trait_in_assoc_ty.rs:11:28
+ |
+LL | type Foo = impl std::fmt::Debug;
+ | -------------------- the expected opaque type
+LL | fn bar() {
+LL | let x: Self::Foo = ();
+ | --------- ^^ expected opaque type, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected opaque type `<() as Foo>::Foo`
+ found unit type `()`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/invalid_impl_trait_in_assoc_ty.rs:10:5
+ |
+LL | fn bar() {
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.