1 error[E0271]: type mismatch resolving `<Bar as Iterator>::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
2 --> $DIR/issue-70877.rs:7:12
4 LL | type FooRet = impl std::fmt::Debug;
5 | -------------------- the found opaque type
7 LL | type Foo = impl Iterator<Item = FooItem>;
8 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Bar as Iterator>::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
10 note: expected this to be `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
11 --> $DIR/issue-70877.rs:13:17
13 LL | type Item = FooItem;
15 = note: expected struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
16 found struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> impl Debug + 'static)>`
18 error: aborting due to previous error
20 For more information about this error, try `rustc --explain E0271`.