summaryrefslogtreecommitdiffstats
path: root/third_party/rust/pin-project/tests/ui/project/invalid.rs
blob: bc7226deb27d22fbd25536b49de50291903edb4c (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
use pin_project::{pin_project, project};

#[pin_project]
struct A<T> {
    #[pin]
    future: T,
}

#[project]
fn foo() {
    let mut x = A { future: 0 };
    #[project(foo)] //~ ERROR unexpected token
    let A { future } = Pin::new(&mut x).project();
}

#[project]
fn bar() {
    let mut x = A { future: 0 };
    #[project]
    #[project] //~ ERROR duplicate #[project] attribute
    let A { future } = Pin::new(&mut x).project();
}

fn main() {}