use synonym::Synonym; #[derive(Synonym, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Default, Debug)] #[synonym(skip(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Default, Debug, AsRef, From, FromStr, Display))] struct FooU32(u32); impl core::convert::AsRef for FooU32 { fn as_ref(&self) -> &u32 { unimplemented!() } } impl core::convert::From for FooU32 { fn from(_t: u32) -> Self { unimplemented!() } } impl core::convert::From for u32 { fn from(_t: FooU32) -> Self { unimplemented!() } } impl ::core::str::FromStr for FooU32 { type Err = ::Err; fn from_str(_s: &str) -> Result { unimplemented!() } } impl ::core::fmt::Display for FooU32 { fn fmt(&self, _f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { unimplemented!() } } #[derive(Synonym)] #[synonym(skip(String))] struct FooString(String); impl ::core::borrow::Borrow for FooString { fn borrow(&self) -> &str { unimplemented!() } } impl<'a> ::core::convert::From<&'a str> for FooString { fn from(_s: &'a str) -> Self { unimplemented!() } } fn main() { let _ = FooU32(42); }