From 6f035289872fccf1aef12f6fd3687f79def75513 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Mon, 4 Aug 2014 22:31:07 -0400 Subject: [PATCH] Fix an infinite loop in serializing boxed types --- src/ser.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ser.rs b/src/ser.rs index 779b18c7..756d3b3b 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -170,7 +170,7 @@ macro_rules! impl_serializable_box { impl<'a, T: Serializable> Serializable for $ty { #[inline] fn serialize, E>(&self, s: &mut S) -> Result<(), E> { - (*self).serialize(s) + (**self).serialize(s) } } } @@ -180,7 +180,13 @@ impl_serializable_box!(&'a T) impl_serializable_box!(Box) impl_serializable_box!(Gc) impl_serializable_box!(Rc) -impl_serializable_box!(Arc) + +impl Serializable for Arc { + #[inline] + fn serialize, E>(&self, s: &mut S) -> Result<(), E> { + (**self).serialize(s) + } +} //////////////////////////////////////////////////////////////////////////////