diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-03-24 15:55:29 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-03-26 17:52:38 -0400 |
| commit | 9c9bb9ce1d51e2a9ca4963bd418e365b6e17fbfa (patch) | |
| tree | 9ba4c4fba17c9d7156bd95b0a46dc1c45f4984c9 /src/liballoc | |
| parent | a923278c6278c63468d74772c58dbf788e88f58c (diff) | |
| download | rust-9c9bb9ce1d51e2a9ca4963bd418e365b6e17fbfa.tar.gz rust-9c9bb9ce1d51e2a9ca4963bd418e365b6e17fbfa.zip | |
Implement `Reflect` trait with a variant on the standard OIBIT
semantics that tests the *interface* of trait objects, rather than what they close over.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<T: 'static>(self) -> Result<Box<T>, Box<Any>>; + fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>>; } #[stable(feature = "rust1", since = "1.0.0")] impl BoxAny for Box<Any> { #[inline] - fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> { + fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> { if self.is::<T>() { unsafe { // Get the raw representation of the trait object @@ -270,7 +270,7 @@ impl BoxAny for Box<Any> { #[stable(feature = "rust1", since = "1.0.0")] impl BoxAny for Box<Any+Send> { #[inline] - fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> { + fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> { <Box<Any>>::downcast(self) } } |
