aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pinned_drop/invalid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pinned_drop/invalid.rs')
-rw-r--r--tests/ui/pinned_drop/invalid.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/pinned_drop/invalid.rs b/tests/ui/pinned_drop/invalid.rs
index 9ff5de2..7065ec9 100644
--- a/tests/ui/pinned_drop/invalid.rs
+++ b/tests/ui/pinned_drop/invalid.rs
@@ -204,4 +204,26 @@ mod method {
}
}
+mod self_ty {
+ use pin_project::pinned_drop;
+
+ #[pinned_drop]
+ impl PinnedDrop for () {
+ //~^ ERROR implementing the trait `PinnedDrop` on this type is unsupported
+ fn drop(self: Pin<&mut Self>) {}
+ }
+
+ #[pinned_drop]
+ impl PinnedDrop for &mut A {
+ //~^ ERROR implementing the trait `PinnedDrop` on this type is unsupported
+ fn drop(self: Pin<&mut Self>) {}
+ }
+
+ #[pinned_drop]
+ impl PinnedDrop for [A] {
+ //~^ ERROR implementing the trait `PinnedDrop` on this type is unsupported
+ fn drop(self: Pin<&mut Self>) {}
+ }
+}
+
fn main() {}