use oss_derive::oss_gen_rc; fn main() { assert!(true); } struct ArcPointer; #[cfg(feature = "blocking")] struct RcPointer; #[allow(dead_code)] struct Demo { inner: T, string: &'static str, } impl Demo { fn new(inner: T, string: &'static str) -> Self { Self { inner, string } } } #[oss_gen_rc] impl PartialEq> for Demo { fn eq(&self, other: &Demo) -> bool { self.string == other.string } } #[test] fn test_arc_eq() { let val1 = Demo::new(ArcPointer, "foo1"); let val2 = Demo::new(ArcPointer, "foo1"); assert!(val1 == val2); } #[cfg(feature = "blocking")] #[test] fn test_rc_eq() { let val1 = Demo::new(RcPointer, "foo1"); let val2 = Demo::new(RcPointer, "foo1"); assert!(val1 == val2); }