summaryrefslogtreecommitdiffstats
path: root/third_party/rust/pin-project/examples/not_unpin.rs
blob: 2ad72a87f2922f7ae083886e3bd72de8adc32adc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// See ./not_unpin-expanded.rs for generated code.

#![allow(dead_code)]

use pin_project::pin_project;

#[pin_project(!Unpin)]
pub struct Struct<T, U> {
    #[pin]
    pinned: T,
    unpinned: U,
}

fn main() {
    fn _is_unpin<T: Unpin>() {}
    // _is_unpin::<Struct<(), ()>>(); //~ ERROR `std::marker::PhantomPinned` cannot be unpinned
}