]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/issue-36053-2.stderr
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / 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    |                                ^^^^^^ ---------
6    |                                |      |   |
7    |                                |      |   help: consider borrowing the argument: `&&str`
8    |                                |      found signature defined here
9    |                                expected due to this
10    |
11    = note: expected closure signature `for<'a> fn(&'a &str) -> _`
12               found closure signature `for<'a> fn(&'a str) -> _`
13 note: required by a bound in `filter`
14   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
15
16 error[E0599]: the method `count` exists for struct `Filter<Fuse<Once<&str>>, [closure@issue-36053-2.rs:7:39]>`, but its trait bounds were not satisfied
17   --> $DIR/issue-36053-2.rs:7:55
18    |
19 LL |     once::<&str>("str").fuse().filter(|a: &str| true).count();
20    |                                       ---------       ^^^^^ method cannot be called due to unsatisfied trait bounds
21    |                                       |
22    |                                       doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
23    |                                       doesn't satisfy `_: FnMut<(&&str,)>`
24   --> $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
25    |
26    = note: doesn't satisfy `_: Iterator`
27    |
28    = note: the following trait bounds were not satisfied:
29            `<[closure@$DIR/issue-36053-2.rs:7:39: 7:48] as FnOnce<(&&str,)>>::Output = bool`
30            which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
31            `[closure@$DIR/issue-36053-2.rs:7:39: 7:48]: FnMut<(&&str,)>`
32            which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
33            `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
34            which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
35
36 error: aborting due to 2 previous errors
37
38 Some errors have detailed explanations: E0599, E0631.
39 For more information about an error, try `rustc --explain E0599`.