blob: 106288b054d5dc639335661bf0ebbe4b7677f1ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
fn test1() {
let mut chars = "Hello".chars();
for _c in chars.by_ref() {
chars.next(); //~ ERROR cannot borrow `chars` as mutable more than once at a time
}
}
fn test2() {
let v = vec![1, 2, 3];
let mut iter = v.iter();
for _i in iter {
iter.next(); //~ ERROR borrow of moved value: `iter`
}
}
fn main() { }
|