2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-05-08 08:10:16 -05:00
|
|
|
// Tests that codegen_path checks whether a
|
|
|
|
// pattern-bound var is an upvar (when codegenning
|
2011-07-05 21:57:34 -05:00
|
|
|
// the for-each body)
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn foo(src: usize) {
|
2011-07-05 21:57:34 -05:00
|
|
|
|
2012-08-20 14:23:37 -05:00
|
|
|
match Some(src) {
|
|
|
|
Some(src_id) => {
|
2015-02-18 04:42:01 -06:00
|
|
|
for _i in 0_usize..10_usize {
|
2011-07-27 07:19:39 -05:00
|
|
|
let yyy = src_id;
|
2015-02-18 04:42:01 -06:00
|
|
|
assert_eq!(yyy, 0_usize);
|
2011-10-21 07:12:12 -05:00
|
|
|
}
|
2011-07-27 07:19:39 -05:00
|
|
|
}
|
2012-08-03 21:59:04 -05:00
|
|
|
_ => { }
|
2011-07-05 21:57:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-18 04:42:01 -06:00
|
|
|
pub fn main() { foo(0_usize); }
|