rust/src/test/run-pass/pattern-bound-var-in-for-each.rs
2012-05-26 02:28:00 -07:00

19 lines
340 B
Rust

// Tests that trans_path checks whether a
// pattern-bound var is an upvar (when translating
// the for-each body)
fn foo(src: uint) {
alt some(src) {
some(src_id) {
for uint::range(0u, 10u) {|i|
let yyy = src_id;
assert (yyy == 0u);
}
}
_ { }
}
}
fn main() { foo(0u); }