]> git.proxmox.com Git - rustc.git/blame - src/test/ui/mismatched_types/issue-36053-2.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / mismatched_types / issue-36053-2.stderr
CommitLineData
29967ef6
XL
1error[E0631]: type mismatch in closure arguments
2 --> $DIR/issue-36053-2.rs:7:32
3 |
4LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
064997fb 5 | ^^^^^^ --------- found signature defined here
29967ef6 6 | |
064997fb 7 | expected due to this
3c0e092e 8 |
2b03887a
FG
9 = note: expected closure signature `for<'a> fn(&'a &str) -> _`
10 found closure signature `for<'a> fn(&'a str) -> _`
3c0e092e
XL
11note: required by a bound in `filter`
12 --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
13 |
14LL | P: FnMut(&Self::Item) -> bool,
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter`
29967ef6 16
064997fb 17error[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
ba9703b0 18 --> $DIR/issue-36053-2.rs:7:55
7cac9316 19 |
0531ce1d 20LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
064997fb 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
74b04a01 22 | |
1b1a35ee
XL
23 | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
24 | doesn't satisfy `_: FnMut<(&&str,)>`
94222f64 25 |
fc512014 26 ::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
74b04a01
XL
27 |
28LL | pub struct Filter<I, P> {
1b1a35ee 29 | ----------------------- doesn't satisfy `_: Iterator`
7cac9316 30 |
5869c6ff 31 = note: the following trait bounds were not satisfied:
064997fb
FG
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`
7cac9316 38
e74abb32 39error: aborting due to 2 previous errors
7cac9316 40
60c5eb7d
XL
41Some errors have detailed explanations: E0599, E0631.
42For more information about an error, try `rustc --explain E0599`.