rust/tests/ui/type-alias-impl-trait/normalize-hidden-types.curr...

56 lines
2.2 KiB
Plaintext

error: concrete type differs from previous defining opaque type use
--> $DIR/normalize-hidden-types.rs:26:20
|
LL | fn define() -> Opaque {
| ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
|
note: previous use here
--> $DIR/normalize-hidden-types.rs:27:9
|
LL | dyn_hoops::<_>(0)
| ^^^^^^^^^^^^^^^^^
error: concrete type differs from previous defining opaque type use
--> $DIR/normalize-hidden-types.rs:34:22
|
LL | fn define_1() -> Opaque { dyn_hoops::<_>(0) }
| ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
|
note: previous use here
--> $DIR/normalize-hidden-types.rs:34:31
|
LL | fn define_1() -> Opaque { dyn_hoops::<_>(0) }
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/normalize-hidden-types.rs:43:25
|
LL | type Opaque = impl Sized;
| ---------- the expected opaque type
...
LL | let _: Opaque = dyn_hoops::<u8>(0);
| ------ ^^^^^^^^^^^^^^^^^^ expected opaque type, found `*const dyn FnOnce(())`
| |
| expected due to this
|
= note: expected opaque type `typeck::Opaque`
found raw pointer `*const (dyn FnOnce(()) + 'static)`
= help: consider constraining the associated type `<u8 as Trait>::Gat<'_>` to `()` or calling a method that returns `<u8 as Trait>::Gat<'_>`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error: concrete type differs from previous defining opaque type use
--> $DIR/normalize-hidden-types.rs:52:25
|
LL | let _: Opaque = dyn_hoops::<_>(0);
| ^^^^^^^^^^^^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
|
note: previous use here
--> $DIR/normalize-hidden-types.rs:53:9
|
LL | None
| ^^^^
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.