rust/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc...

23 lines
780 B
Plaintext

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:8
|
LL | fn bar() {
| ^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.