use pin_project::{pin_project, UnsafeUnpin}; #[pin_project(UnsafeUnpin, project = EnumProj, project_ref = EnumProjRef)] enum Enum { Struct { #[pin] pinned: T, unpinned: U, }, Tuple(#[pin] T, U), Unit, } unsafe impl UnsafeUnpin for Enum {} fn main() {}