]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17068.rs
Auto merge of #79113 - andjo403:raw_vec_ptr, r=m-ou-se
[rust.git] / src / test / ui / issues / issue-17068.rs
1 // run-pass
2 // Test that regionck creates the right region links in the pattern
3 // binding of a for loop
4
5 fn foo<'a>(v: &'a [usize]) -> &'a usize {
6     for &ref x in v { return x; }
7     unreachable!()
8 }
9
10 fn main() {
11     assert_eq!(foo(&[0]), &0);
12 }