rust/src/test/run-pass/issue-3211.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
132 B
Rust

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