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