rust/src/test/run-pass/issue-4401.rs
blake2-ppc 78cde5b9fb std: Change Times trait to use do instead of for
Change the former repetition::

    for 5.times { }

to::

    do 5.times { }

.times() cannot be broken with `break` or `return` anymore; for those
cases, use a numerical range loop instead.
2013-08-01 16:54:22 +02:00

9 lines
152 B
Rust

pub fn main() {
let mut count = 0;
do 999_999.times() {
count += 1;
}
assert_eq!(count, 999_999);
printfln!("%u", count);
}