]> git.proxmox.com Git - rustc.git/blob - vendor/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / vendor / pin-project-lite / tests / ui / pinned_drop / conditional-drop-impl.rs
1 use pin_project_lite::pin_project;
2
3 // In `Drop` impl, the implementor must specify the same requirement as type definition.
4
5 struct DropImpl<T> {
6 f: T,
7 }
8
9 impl<T: Unpin> Drop for DropImpl<T> {
10 //~^ ERROR E0367
11 fn drop(&mut self) {}
12 }
13
14 pin_project! {
15 //~^ ERROR E0367
16 struct PinnedDropImpl<T> {
17 #[pin]
18 f: T,
19 }
20
21 impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
22 fn drop(_this: Pin<&mut Self>) {}
23 }
24 }
25
26 fn main() {}