From dd8fdff4fb6cbf63ef47e4a29c2cfb63e21f9744 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 22 Dec 2014 20:15:43 -0800 Subject: [PATCH] Regression test for #8874 Closes #8874. --- .../inconsistent-lifetime-mismatch.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/run-pass/inconsistent-lifetime-mismatch.rs 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 or the MIT license +// , 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() {}