2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2014-11-08 11:04:37 -08:00
|
|
|
// Test that regionck creates the right region links in the pattern
|
|
|
|
// binding of a for loop
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn foo<'a>(v: &'a [usize]) -> &'a usize {
|
2015-01-31 12:20:46 -05:00
|
|
|
for &ref x in v { return x; }
|
2014-11-08 11:04:37 -08:00
|
|
|
unreachable!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(foo(&[0]), &0);
|
|
|
|
}
|