From c8c039151963e29b92978444f2dc6590dd173ece Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 28 Nov 2014 15:41:16 +1300 Subject: Add some impls of Show (RefCell, Weak, some resolve types) --- src/liballoc/rc.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/liballoc') diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 75d4342083b..436b134ad25 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -719,6 +719,17 @@ impl Clone for Weak { } } +#[experimental = "Show is experimental."] +impl fmt::Show for Weak { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if self.strong() == 0 { + write!(f, "NULL") + } else { + (*self._ptr).fmt(f) + } + } +} + #[doc(hidden)] trait RcBoxPtr { fn inner(&self) -> &RcBox; -- cgit 1.4.1-3-g733a5