• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
drop(&mut self)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 
main()26 fn main() {}
27