extern crate futures03_crate as futures; use auto_enums::enum_derive; enum Enum { A(A), B(B), } impl ::futures::io::AsyncSeek for Enum where A: ::futures::io::AsyncSeek, B: ::futures::io::AsyncSeek, { #[inline] fn poll_seek( self: ::core::pin::Pin<&mut Self>, cx: &mut ::core::task::Context<'_>, pos: ::std::io::SeekFrom, ) -> ::core::task::Poll<::std::io::Result> { unsafe { match self.get_unchecked_mut() { Enum::A(x) => { ::poll_seek( ::core::pin::Pin::new_unchecked(x), cx, pos, ) } Enum::B(x) => { ::poll_seek( ::core::pin::Pin::new_unchecked(x), cx, pos, ) } } } } } impl ::core::marker::Unpin for Enum where A: ::core::marker::Unpin, B: ::core::marker::Unpin, {} const _: () = { trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} impl MustNotImplDrop for Enum {} }; fn main() {}