2011-07-05 19:57:34 -07:00
|
|
|
// Tests that trans_path checks whether a
|
|
|
|
// pattern-bound var is an upvar (when translating
|
|
|
|
// the for-each body)
|
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn foo(src: uint) {
|
2011-07-05 19:57:34 -07:00
|
|
|
|
2012-08-20 12:23:37 -07:00
|
|
|
match Some(src) {
|
|
|
|
Some(src_id) => {
|
2012-06-30 16:19:07 -07:00
|
|
|
for uint::range(0u, 10u) |i| {
|
2011-07-27 14:19:39 +02:00
|
|
|
let yyy = src_id;
|
2011-07-05 19:57:34 -07:00
|
|
|
assert (yyy == 0u);
|
2011-10-21 14:12:12 +02:00
|
|
|
}
|
2011-07-27 14:19:39 +02:00
|
|
|
}
|
2012-08-03 19:59:04 -07:00
|
|
|
_ => { }
|
2011-07-05 19:57:34 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-15 21:54:52 -07:00
|
|
|
fn main() { foo(0u); }
|