summaryrefslogtreecommitdiffstats
path: root/tests/ui/self/self_lifetime-async.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/self/self_lifetime-async.rs')
-rw-r--r--tests/ui/self/self_lifetime-async.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/self/self_lifetime-async.rs b/tests/ui/self/self_lifetime-async.rs
new file mode 100644
index 000000000..c3c6e5658
--- /dev/null
+++ b/tests/ui/self/self_lifetime-async.rs
@@ -0,0 +1,14 @@
+// check-pass
+// edition:2018
+
+struct Foo<'a>(&'a ());
+impl<'a> Foo<'a> {
+ async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
+}
+
+type Alias = Foo<'static>;
+impl Alias {
+ async fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
+}
+
+fn main() {}