aboutsummaryrefslogtreecommitdiff
path: root/tests/pinned_drop.rs
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-05-19 16:12:52 -0700
committerJoel Galenson <jgalenson@google.com>2021-05-19 16:12:52 -0700
commitc95dc516440636acb2e9f0b61e3a4595a90c4d2e (patch)
treea2808291a9d00789d7f23e0e6bc9e133aace307a /tests/pinned_drop.rs
parent1a7271af628c203700f21c3b3eac18bbd7373340 (diff)
downloadpin-project-c95dc516440636acb2e9f0b61e3a4595a90c4d2e.tar.gz
Upgrade rust/crates/pin-project to 1.0.7
Test: make Change-Id: I9cb8c4f9c94d68c5775ee9a360f4e882a836e186
Diffstat (limited to 'tests/pinned_drop.rs')
-rw-r--r--tests/pinned_drop.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/pinned_drop.rs b/tests/pinned_drop.rs
index 9e7287d..785cea3 100644
--- a/tests/pinned_drop.rs
+++ b/tests/pinned_drop.rs
@@ -262,3 +262,23 @@ fn inside_macro() {
mac!(1);
}
+
+pub mod self_path {
+ use super::*;
+
+ #[pin_project(PinnedDrop)]
+ pub struct S<T: Unpin>(T);
+
+ fn f() {}
+
+ #[pinned_drop]
+ impl<T: Unpin> PinnedDrop for self::S<T> {
+ fn drop(mut self: Pin<&mut Self>) {
+ self::f();
+ let _: self::S<()> = self::S(());
+ let _: self::S<Pin<&mut Self>> = self::S(self.as_mut());
+ let self::S(()) = self::S(());
+ let self::S(&mut Self(_)) = self::S(&mut *self);
+ }
+ }
+}