From 3d9a7d91405719d82496e882e22e3797f29d632f Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 27 Mar 2016 02:44:55 +0530 Subject: [PATCH] Add test for new() -> Self<'static> --- tests/compile-fail/methods.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/compile-fail/methods.rs b/tests/compile-fail/methods.rs index edbdeb2e55a..74f262b05a7 100644 --- a/tests/compile-fail/methods.rs +++ b/tests/compile-fail/methods.rs @@ -47,6 +47,15 @@ impl<'a> Lt2<'a> { pub fn new(s: &str) -> Lt2 { unimplemented!() } } +struct Lt3<'a> { + foo: &'a u32, +} + +impl<'a> Lt3<'a> { + // The lifetime is different, but that’s irrelevant, see #734 + pub fn new() -> Lt3<'static> { unimplemented!() } +} + #[derive(Clone,Copy)] struct U;