diff options
Diffstat (limited to 'src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs')
-rw-r--r-- | src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs b/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs deleted file mode 100644 index 39872825c..000000000 --- a/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs +++ /dev/null @@ -1,14 +0,0 @@ -fn a<'a>() -> &'a isize { - let vec = vec![1, 2, 3, 4]; - let vec: &[isize] = &vec; - let tail = match vec { - &[_a, ref tail @ ..] => &tail[0], - _ => panic!("foo") - }; - tail //~ ERROR cannot return value referencing local variable `vec` -} - -fn main() { - let fifth = a(); - println!("{}", *fifth); -} |