]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-36053-2.stderr
Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplett
[rust.git] / src / test / ui / mismatched_types / issue-36053-2.stderr
1 error[E0599]: no method named `count` found for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>` in the current scope
2   --> $DIR/issue-36053-2.rs:7:55
3    |
4 LL |     once::<&str>("str").fuse().filter(|a: &str| true).count();
5    |                                       --------------  ^^^^^ method not found in `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>`
6    |                                       |
7    |                                       doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
8    |                                       doesn't satisfy `_: FnMut<(&&str,)>`
9    | 
10   ::: $SRC_DIR/core/src/iter/adapters/mod.rs:LL:COL
11    |
12 LL | pub struct Filter<I, P> {
13    | ----------------------- doesn't satisfy `_: Iterator`
14    |
15    = note: the method `count` exists but the following trait bounds were not satisfied:
16            `<[closure@$DIR/issue-36053-2.rs:7:39: 7:53] as FnOnce<(&&str,)>>::Output = bool`
17            which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
18            `[closure@$DIR/issue-36053-2.rs:7:39: 7:53]: FnMut<(&&str,)>`
19            which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
20            `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
21            which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
22
23 error[E0631]: type mismatch in closure arguments
24   --> $DIR/issue-36053-2.rs:7:32
25    |
26 LL |     once::<&str>("str").fuse().filter(|a: &str| true).count();
27    |                                ^^^^^^ -------------- found signature of `for<'r> fn(&'r str) -> _`
28    |                                |
29    |                                expected signature of `for<'r> fn(&'r &str) -> _`
30
31 error: aborting due to 2 previous errors
32
33 Some errors have detailed explanations: E0599, E0631.
34 For more information about an error, try `rustc --explain E0599`.