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/mod.rs:LL:COL
18 LL | pub struct Cloned<I> {
19 | -------------------- doesn't satisfy `_: Iterator`
21 LL | pub struct TakeWhile<I, P> {
22 | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_`
24 = note: the method `collect` exists but the following trait bounds were not satisfied:
25 `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item = &_`
26 which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
27 `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
28 which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
30 error: aborting due to 2 previous errors
32 Some errors have detailed explanations: E0271, E0599.
33 For more information about an error, try `rustc --explain E0271`.