use the_newtype::Newtype; struct Foo; #[derive(Newtype)] struct FooTuple(Foo); #[derive(Newtype)] #[allow(dead_code)] struct FooStruct { foo: Foo, } #[derive(Newtype)] struct Wrapper(T); #[derive(Newtype)] struct WrapperList(Vec); #[derive(Newtype)] struct WrapperRef<'a, T>(&'a T); #[test] fn test() { assert_eq!( std::any::TypeId::of::<::Inner>(), std::any::TypeId::of::() ); assert_eq!( std::any::TypeId::of::<::Inner>(), std::any::TypeId::of::() ); assert_eq!( std::any::TypeId::of::< as Newtype>::Inner>(), std::any::TypeId::of::() ); assert_eq!( std::any::TypeId::of::< as Newtype>::Inner>(), std::any::TypeId::of::>() ); assert_eq!( std::any::TypeId::of::< as Newtype>::Inner>(), std::any::TypeId::of::<&Foo>() ); }