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