summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-18 17:13:11 +0000
committerbors <bors@rust-lang.org>2018-07-18 17:13:11 +0000
commit58cc626de3301192d5d8c6dcbde43b5b44211ae2 (patch)
tree59829d59479b725a1eb33767b9d0a6d16b598662 /src/test
parent5f2b325f64ed6caa7179f3e04913db437656ec7e (diff)
parent9ea66dc4c5570fc87185e0d68bb2846a9a452624 (diff)
downloadrust-1.27.2.tar.gz
rust-1.27.2.zip
Auto merge of #52481 - Mark-Simulacrum:stable-next, r=alexcrichton 1.27.2
1.27.2 stable release

This is essentially a backport of https://github.com/rust-lang/rust/pull/52232. I've set the release date for Friday, July 20th.

r? @alexcrichton
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-52213.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-52213.rs b/src/test/compile-fail/issue-52213.rs
new file mode 100644
index 00000000000..810379c63d3
--- /dev/null
+++ b/src/test/compile-fail/issue-52213.rs
@@ -0,0 +1,24 @@
+// Copyright 2017 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 transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
+    match (&t,) { //~ ERROR cannot infer an appropriate lifetime
+        ((u,),) => u,
+    }
+}
+
+fn main() {
+    let x = {
+        let y = Box::new((42,));
+        transmute_lifetime(&y)
+    };
+
+    println!("{}", x);
+}