//! We should assert that each parameter type implements the trait and fail to //! compile if it does not. use shared_memory::SharedMemCast; #[derive(SharedMemCast)] pub struct MyStruct { x: T, } #[derive(SharedMemCast)] pub struct MyStruct2(T); #[derive(SharedMemCast)] pub enum MyData { Foo(i32), Bar { x: f64, yyy: [f64; 32], val: T, } } pub struct NotShared; fn assert_impl() {} fn main() { assert_impl::>(); assert_impl::>>(); assert_impl::>(); fn generic_param() { assert_impl::>(); } assert_impl::>(); assert_impl::>>(); assert_impl::>(); fn generic_param2() { assert_impl::>(); } assert_impl::>(); assert_impl::>>(); assert_impl::>(); fn generic_param3() { assert_impl::>(); } }