about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@squareup.com>2014-12-22 20:15:43 -0800
committerTamir Duberstein <tamird@squareup.com>2014-12-28 09:22:52 -0800
commitdd8fdff4fb6cbf63ef47e4a29c2cfb63e21f9744 (patch)
tree90b430d8e18ed01257d99432a627d426d012f3ac /src
parent5e9a2ab8463e930905afa787546bd696456e2931 (diff)
downloadrust-dd8fdff4fb6cbf63ef47e4a29c2cfb63e21f9744.tar.gz
rust-dd8fdff4fb6cbf63ef47e4a29c2cfb63e21f9744.zip
Regression test for #8874
Closes #8874.
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/inconsistent-lifetime-mismatch.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/run-pass/inconsistent-lifetime-mismatch.rs b/src/test/run-pass/inconsistent-lifetime-mismatch.rs
new file mode 100644
index 00000000000..b30583c6668
--- /dev/null
+++ b/src/test/run-pass/inconsistent-lifetime-mismatch.rs
@@ -0,0 +1,21 @@
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo(_: &[&str]) {}
+
+fn bad(a: &str, b: &str) {
+    foo(&[a, b]);
+}
+
+fn good(a: &str, b: &str) {
+    foo(&[a.as_slice(), b.as_slice()]);
+}
+
+fn main() {}