Closed valff closed 7 years ago
Also possibly a related bug. I'm trying to emulate generic associated types:
trait Foo<'a> {
type Bar;
}
trait Bar: for<'a> Foo<'a> {
fn f<F>(&mut self, f: F)
where
F: for<'a> FnOnce(<Self as Foo<'a>>::Bar) -> <Self as Foo<'a>>::Bar,
{
}
}
fn main() {}
I confused with the error:
error[E0582]: binding for associated type
Output
references lifetime'a
, which does not appear in the trait input types
Input and output should be the same. Why output references 'a
, while input not?
If this is not a bug, I'll appreciate any hints to workaround this limitation.
Thanks for the bug report, @valff. Closing as duplicate of https://github.com/rust-lang/rust/issues/43623.
Internal compiler error on stable 1.22.1.
Playground
Output: