]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/issue-31173.stderr
Rollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors
[rust.git] / tests / ui / typeck / issue-31173.stderr
1 error[E0271]: expected `TakeWhile<&mut IntoIter<u8>, [closure@issue-31173.rs:7:21]>` to be an iterator that yields `&_`, but it yields `u8`
2   --> $DIR/issue-31173.rs:11:10
3    |
4 LL |         .cloned()
5    |          ^^^^^^ expected reference, found `u8`
6    |
7    = note: expected reference `&_`
8                    found type `u8`
9 note: the method call chain might not have had the expected associated types
10   --> $DIR/issue-31173.rs:3:20
11    |
12 LL |   pub fn get_tok(it: &mut IntoIter<u8>) {
13    |                      ^^^^^^^^^^^^^^^^^ `Iterator::Item` is `u8` here
14 ...
15 LL |           .take_while(|&x| {
16    |  __________-
17 LL | |             found_e = true;
18 LL | |             false
19 LL | |         })
20    | |__________- `Iterator::Item` remains `u8` here
21 note: required by a bound in `cloned`
22   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
23
24 error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut IntoIter<u8>, [closure@issue-31173.rs:7:21]>>`, but its trait bounds were not satisfied
25   --> $DIR/issue-31173.rs:12:10
26    |
27 LL |         .collect();
28    |          ^^^^^^^ method cannot be called due to unsatisfied trait bounds
29   --> $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
30    |
31    = note: doesn't satisfy `<_ as Iterator>::Item = &_`
32   --> $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
33    |
34    = note: doesn't satisfy `_: Iterator`
35    |
36    = note: the following trait bounds were not satisfied:
37            `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:7:21: 7:25]> as Iterator>::Item = &_`
38            which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>: Iterator`
39            `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>: Iterator`
40            which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>: Iterator`
41
42 error: aborting due to 2 previous errors
43
44 Some errors have detailed explanations: E0271, E0599.
45 For more information about an error, try `rustc --explain E0271`.