about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2020-04-25 10:43:41 +0200
committerPhilipp Hansch <dev@phansch.net>2020-04-25 10:43:41 +0200
commitbf73d519597dcc8bcf2ac05b106afbd89deb846d (patch)
treed8925095bf65776d57e899e4ce392dafba1b70e2
parent02c94352d4bbb055dce656da21d86aa1bf672562 (diff)
downloadrust-bf73d519597dcc8bcf2ac05b106afbd89deb846d.tar.gz
rust-bf73d519597dcc8bcf2ac05b106afbd89deb846d.zip
Add lifetime test case for `new_ret_no_self`
-rw-r--r--tests/ui/new_ret_no_self.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/new_ret_no_self.rs b/tests/ui/new_ret_no_self.rs
index 35aaecc9ac4..2c2d1e27589 100644
--- a/tests/ui/new_ret_no_self.rs
+++ b/tests/ui/new_ret_no_self.rs
@@ -199,3 +199,14 @@ impl NestedReturnerOk3 {
         unimplemented!();
     }
 }
+
+struct WithLifetime<'a> {
+    cat: &'a str,
+}
+
+impl<'a> WithLifetime<'a> {
+    // should not trigger the lint, because the lifetimes are different
+    pub fn new<'b: 'a>(s: &'b str) -> WithLifetime<'b> {
+        unimplemented!();
+    }
+}