Closed
Description
Given the following code:
fn bar<Input>() -> impl Fn(Input) {
|i| todo!()
}
fn foo() -> impl Fn(&str) {
bar()
}
The current output is:
error[E0308]: mismatched types
--> src/lib.rs:5:13
|
1 | fn bar<Input>() -> impl Fn(Input) {
| --------------
| |
| the expected opaque type
| the found opaque type
...
5 | fn foo() -> impl Fn(&str) {
| ^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected associated type `<impl Fn<(&str,)> as FnOnce<(&str,)>>::Output`
found associated type `<impl Fn<(&str,)> as FnOnce<(&str,)>>::Output`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` due to previous error
It seems like a bug that the "expected" and "found" types are the same.