about summary refs log tree commit diff
path: root/tests/ui/iterators/for-loop-over-mut-iterator-21655.rs
blob: b5c9826bd4543e88ec8852c9d531331e46364c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// https://github.com/rust-lang/rust/issues/21655
//@ run-pass

fn test(it: &mut dyn Iterator<Item=i32>) {
    for x in it {
        assert_eq!(x, 1)
    }
}

fn main() {
    let v = vec![1];
    test(&mut v.into_iter())
}