]> git.proxmox.com Git - rustc.git/blob - src/test/ui/mismatched_types/issue-36053-2.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / mismatched_types / issue-36053-2.stderr
1 error[E0631]: type mismatch in closure arguments
2 --> $DIR/issue-36053-2.rs:7:32
3 |
4 LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
5 | ^^^^^^ -------------- found signature of `for<'r> fn(&'r str) -> _`
6 | |
7 | expected signature of `for<'r> fn(&'r &str) -> _`
8
9 error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>`, but its trait bounds were not satisfied
10 --> $DIR/issue-36053-2.rs:7:55
11 |
12 LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
13 | -------------- ^^^^^ method cannot be called on `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>` due to unsatisfied trait bounds
14 | |
15 | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
16 | doesn't satisfy `_: FnMut<(&&str,)>`
17 |
18 ::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
19 |
20 LL | pub struct Filter<I, P> {
21 | ----------------------- doesn't satisfy `_: Iterator`
22 |
23 = note: the following trait bounds were not satisfied:
24 `<[closure@$DIR/issue-36053-2.rs:7:39: 7:53] as FnOnce<(&&str,)>>::Output = bool`
25 which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
26 `[closure@$DIR/issue-36053-2.rs:7:39: 7:53]: FnMut<(&&str,)>`
27 which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
28 `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
29 which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator`
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`.