1 error[E0631]: type mismatch in closure arguments
2 --> $DIR/issue-36053-2.rs:7:32
4 LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
5 | ^^^^^^ --------- found signature defined here
9 = note: expected closure signature `for<'r> fn(&'r &str) -> _`
10 found closure signature `for<'r> fn(&'r str) -> _`
11 note: required by a bound in `filter`
12 --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
14 LL | P: FnMut(&Self::Item) -> bool,
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter`
17 error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
18 --> $DIR/issue-36053-2.rs:7:55
20 LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
21 | --------- ^^^^^ method cannot be called on `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>` due to unsatisfied trait bounds
23 | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
24 | doesn't satisfy `_: FnMut<(&&str,)>`
26 ::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
28 LL | pub struct Filter<I, P> {
29 | ----------------------- doesn't satisfy `_: Iterator`
31 = note: the following trait bounds were not satisfied:
32 `<[closure@$DIR/issue-36053-2.rs:7:39: 7:48] as FnOnce<(&&str,)>>::Output = bool`
33 which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
34 `[closure@$DIR/issue-36053-2.rs:7:39: 7:48]: FnMut<(&&str,)>`
35 which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
36 `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
37 which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
39 error: aborting due to 2 previous errors
41 Some errors have detailed explanations: E0599, E0631.
42 For more information about an error, try `rustc --explain E0599`.