From 827999cd1fe866582007611becd1bfeb02405c6f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 20 May 2014 21:44:22 -0700 Subject: [PATCH] test: Add a test for fixed issue #12567 Closes #12567 --- src/test/compile-fail/issue-12567.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/compile-fail/issue-12567.rs diff --git a/src/test/compile-fail/issue-12567.rs b/src/test/compile-fail/issue-12567.rs new file mode 100644 index 000000000000..d5a8339ba193 --- /dev/null +++ b/src/test/compile-fail/issue-12567.rs @@ -0,0 +1,23 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) { + match (l1, l2) { + ([], []) => println!("both empty"), + ([], [hd, ..tl]) | ([hd, ..tl], []) => println!("one empty"), + //~^ ERROR: cannot move out of dereference + //~^^ ERROR: cannot move out of dereference + ([hd1, ..tl1], [hd2, ..tl2]) => println!("both nonempty"), + //~^ ERROR: cannot move out of dereference + //~^^ ERROR: cannot move out of dereference + } +} + +fn main() {}