aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pin_project/conflict-drop.rs
blob: 4fdb118d06ffb070b71006995b374f03de771292 (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
32
use std::pin::Pin;

use pin_project::{pin_project, pinned_drop};

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

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

#[pin_project(PinnedDrop)] //~ ERROR E0119
struct Bar<T, U> {
    #[pin]
    f1: T,
    f2: 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() {}