]> git.lizzy.rs Git - rust.git/commitdiff
Add test for new() -> Self<'static>
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 26 Mar 2016 21:14:55 +0000 (02:44 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 26 Mar 2016 21:16:37 +0000 (02:46 +0530)
tests/compile-fail/methods.rs

index edbdeb2e55a71b1ffbf867be59a1eac8949b747e..74f262b05a78e163ea608ae53dc679a317e1d181 100644 (file)
@@ -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;