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
5 | ^^^^^^ expected reference, found `u8`
7 = note: expected reference `&_`
9 note: the method call chain might not have had the expected associated types
10 --> $DIR/issue-31173.rs:3:20
12 LL | pub fn get_tok(it: &mut IntoIter<u8>) {
13 | ^^^^^^^^^^^^^^^^^ `Iterator::Item` is `u8` here
15 LL | .take_while(|&x| {
17 LL | | found_e = true;
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
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
28 | ^^^^^^^ method cannot be called due to unsatisfied trait bounds
29 --> $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
31 = note: doesn't satisfy `<_ as Iterator>::Item = &_`
32 --> $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
34 = note: doesn't satisfy `_: Iterator`
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`
42 error: aborting due to 2 previous errors
44 Some errors have detailed explanations: E0271, E0599.
45 For more information about an error, try `rustc --explain E0271`.