aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pinned_drop/conditional-drop-impl.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pinned_drop/conditional-drop-impl.stderr')
-rw-r--r--tests/ui/pinned_drop/conditional-drop-impl.stderr26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/pinned_drop/conditional-drop-impl.stderr b/tests/ui/pinned_drop/conditional-drop-impl.stderr
new file mode 100644
index 0000000..ad8fb69
--- /dev/null
+++ b/tests/ui/pinned_drop/conditional-drop-impl.stderr
@@ -0,0 +1,26 @@
+error[E0367]: `Drop` impl requires `T: std::marker::Unpin` but the struct it is implemented for does not
+ --> $DIR/conditional-drop-impl.rs:10:9
+ |
+10 | impl<T: Unpin> Drop for DropImpl<T> {
+ | ^^^^^
+ |
+note: the implementor must specify the same requirement
+ --> $DIR/conditional-drop-impl.rs:6:1
+ |
+6 | / struct DropImpl<T> {
+7 | | field: T,
+8 | | }
+ | |_^
+
+error[E0277]: `T` cannot be unpinned
+ --> $DIR/conditional-drop-impl.rs:15:15
+ |
+15 | #[pin_project(PinnedDrop)] //~ ERROR E0277
+ | ^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `T`
+ |
+ = note: required because of the requirements on the impl of `pin_project::__private::PinnedDrop` for `PinnedDropImpl<T>`
+ = note: required by `pin_project::__private::PinnedDrop::drop`
+help: consider restricting type parameter `T`
+ |
+16 | struct PinnedDropImpl<T: std::marker::Unpin> {
+ | ^^^^^^^^^^^^^^^^^^^^