Debian Codegraph @

vendor/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs

raw
1 // SPDX-License-Identifier: Apache-2.0 OR MIT
2
3 use pin_project_lite::pin_project;
4
5 // In `Drop` impl, the implementor must specify the same requirement as type definition.
6
7 struct DropImpl<T> {
8 f: T,
9 }
10
11 impl<T: Unpin> Drop for DropImpl<T> {
12 //~^ ERROR E0367
13 fn drop(&mut self) {}
14 }
15
16 pin_project! {
17 //~^ ERROR E0367
18 struct PinnedDropImpl<T> {
19 #[pin]
20 f: T,
21 }
22
23 impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
24 fn drop(_this: Pin<&mut Self>) {}
25 }
26 }
27
28 fn main() {}