summaryrefslogtreecommitdiffstats
path: root/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs')
-rw-r--r--tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs
new file mode 100644
index 000000000..a1e7f4aa8
--- /dev/null
+++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+use std::pin::Pin;
+
+struct Foo;
+
+impl Foo {
+ async fn f(self: Pin<&Self>) -> impl Clone { self }
+ //~^ ERROR: captures lifetime that does not appear in bounds
+}
+
+fn main() {
+ { Pin::new(&Foo).f() };
+}