Files
rust/tests/ui/iterators/for-loop-over-mut-iterator-21655.rs

14 lines
223 B
Rust
Raw Normal View History

2025-07-13 16:39:45 -04:00
// https://github.com/rust-lang/rust/issues/21655
//@ run-pass
2019-05-28 14:47:21 -04:00
fn test(it: &mut dyn Iterator<Item=i32>) {
2015-01-26 10:11:54 -05:00
for x in it {
assert_eq!(x, 1)
}
}
fn main() {
let v = vec![1];
test(&mut v.into_iter())
}