1 error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item == &_`
2 --> $DIR/issue-31173.rs:10:10
5 | ^^^^^^ expected `u8`, found reference
7 = note: expected type `u8`
10 error[E0599]: no method named `collect` found for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` in the current scope
11 --> $DIR/issue-31173.rs:14:10
14 | ^^^^^^^ method not found in `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>`
16 ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
18 LL | pub struct Cloned<I> {
19 | -------------------- doesn't satisfy `_: Iterator`
21 ::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
23 LL | pub struct TakeWhile<I, P> {
24 | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_`
26 = note: the method `collect` exists but the following trait bounds were not satisfied:
27 `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item = &_`
28 which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
29 `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
30 which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
32 error: aborting due to 2 previous errors
34 Some errors have detailed explanations: E0271, E0599.
35 For more information about an error, try `rustc --explain E0271`.