summaryrefslogtreecommitdiffstats
path: root/third_party/rust/pin-project-lite/tests/include/basic.rs
blob: 25121f210b3c5e54f3a35b4b6fa078cd1d61f8c2 (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
33
34
35
// default pin_project! is completely safe.

::pin_project_lite::pin_project! {
    #[derive(Debug)]
    pub struct DefaultStruct<T, U> {
        #[pin]
        pub pinned: T,
        pub unpinned: U,
    }
}

::pin_project_lite::pin_project! {
    #[project = DefaultStructProj]
    #[project_ref = DefaultStructProjRef]
    #[derive(Debug)]
    pub struct DefaultStructNamed<T, U> {
        #[pin]
        pub pinned: T,
        pub unpinned: U,
    }
}

::pin_project_lite::pin_project! {
    #[project = DefaultEnumProj]
    #[project_ref = DefaultEnumProjRef]
    #[derive(Debug)]
    pub enum DefaultEnum<T, U> {
        Struct {
            #[pin]
            pinned: T,
            unpinned: U,
        },
        Unit,
    }
}