summaryrefslogtreecommitdiffstats
path: root/third_party/rust/pin-project/tests/ui/pin_project/add-attr-to-struct.rs
blob: 045e79664d53deba91cf366dc9675ddcec3dce2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::marker::PhantomPinned;

use auxiliary_macro::add_pin_attr;
use pin_project::pin_project;

#[pin_project]
#[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute
struct Foo {
    #[pin]
    f: PhantomPinned,
}

#[add_pin_attr(struct)] //~ ERROR #[pin] attribute may only be used on fields of structs or variants
#[pin_project]
struct Bar {
    #[pin]
    f: PhantomPinned,
}

fn main() {}