aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pin_project/conflict-drop.rs
blob: c9651848a42030492f73502bcf652bdae47a8ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use pin_project::{pin_project, pinned_drop};
use std::pin::Pin;

#[pin_project] //~ ERROR E0119
struct Foo<T, U> {
    #[pin]
    future: T,
    field: U,
}

impl<T, U> Drop for Foo<T, U> {
    fn drop(&mut self) {}
}

#[pin_project(PinnedDrop)] //~ ERROR E0119
struct Bar<T, U> {
    #[pin]
    future: T,
    field: U,
}

#[pinned_drop]
impl<T, U> PinnedDrop for Bar<T, U> {
    fn drop(self: Pin<&mut Self>) {}
}

impl<T, U> Drop for Bar<T, U> {
    fn drop(&mut self) {}
}

fn main() {}