From 9c9bb9ce1d51e2a9ca4963bd418e365b6e17fbfa Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 24 Mar 2015 15:55:29 -0400 Subject: Implement `Reflect` trait with a variant on the standard OIBIT semantics that tests the *interface* of trait objects, rather than what they close over. --- src/liballoc/boxed.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 8b18fbf554a..f9bd0ab2f1e 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -244,13 +244,13 @@ pub trait BoxAny { /// Returns the boxed value if it is of type `T`, or /// `Err(Self)` if it isn't. #[stable(feature = "rust1", since = "1.0.0")] - fn downcast(self) -> Result, Box>; + fn downcast(self) -> Result, Box>; } #[stable(feature = "rust1", since = "1.0.0")] impl BoxAny for Box { #[inline] - fn downcast(self) -> Result, Box> { + fn downcast(self) -> Result, Box> { if self.is::() { unsafe { // Get the raw representation of the trait object @@ -270,7 +270,7 @@ impl BoxAny for Box { #[stable(feature = "rust1", since = "1.0.0")] impl BoxAny for Box { #[inline] - fn downcast(self) -> Result, Box> { + fn downcast(self) -> Result, Box> { >::downcast(self) } } -- cgit 1.4.1-3-g733a5