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