mutagen
mutagen copied to clipboard
iterator mutations fail to typecheck if the loop argument is not exactly an Iterator
pub fn count_to_five() -> usize {
let xs = vec![true, false, true, false, true];
let mut i = 0;
for _x in xs {
i += 1;
}
i
}
compiles normally, but with #[mutate]
, fails with:
error[E0277]: `std::vec::Vec<bool>` is not an iterator
--> src/test.rs:10:1
|
164 | #[mutate]
| ^^^^^^^^^ `std::vec::Vec<bool>` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `std::vec::Vec<bool>`
= note: required by `mutagen::forloop`
error: aborting due to previous error
It works only if i explicitly put xs.iter()
.