about summary refs log tree commit diff
path: root/src/liballoc/boxed.rs
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-07-10 22:32:19 +0200
committerljedrz <ljedrz@gmail.com>2018-07-10 22:32:19 +0200
commitcd44b3ddaddf22ef3c3b00f31491c660b851f8ee (patch)
treee81c86c3a912174e25328f00226b1cc02b95ebe3 /src/liballoc/boxed.rs
parent296e72f11c4120c7b38a0cc580ef8990e7a1c36d (diff)
downloadrust-cd44b3ddaddf22ef3c3b00f31491c660b851f8ee.tar.gz
rust-cd44b3ddaddf22ef3c3b00f31491c660b851f8ee.zip
Add missing dyn in liballoc
Diffstat (limited to 'src/liballoc/boxed.rs')
-rw-r--r--src/liballoc/boxed.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 44f15981137..fb16bdf0ab4 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -446,7 +446,7 @@ impl From<Box<str>> for Box<[u8]> {
     }
 }
 
-impl Box<dyn Any> {
+impl Box<Any> {
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     /// Attempt to downcast the box to a concrete type.
@@ -468,10 +468,10 @@ impl Box<dyn Any> {
     ///     print_if_string(Box::new(0i8));
     /// }
     /// ```
-    pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<dyn Any>> {
+    pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
         if self.is::<T>() {
             unsafe {
-                let raw: *mut dyn Any = Box::into_raw(self);
+                let raw: *mut Any = Box::into_raw(self);
                 Ok(Box::from_raw(raw as *mut T))
             }
         } else {
@@ -480,7 +480,7 @@ impl Box<dyn Any> {
     }
 }
 
-impl Box<dyn Any + Send> {
+impl Box<Any + Send> {
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     /// Attempt to downcast the box to a concrete type.
@@ -502,10 +502,10 @@ impl Box<dyn Any + Send> {
     ///     print_if_string(Box::new(0i8));
     /// }
     /// ```
-    pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<dyn Any + Send>> {
-        <Box<dyn Any>>::downcast(self).map_err(|s| unsafe {
+    pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any + Send>> {
+        <Box<Any>>::downcast(self).map_err(|s| unsafe {
             // reapply the Send marker
-            Box::from_raw(Box::into_raw(s) as *mut (dyn Any + Send))
+            Box::from_raw(Box::into_raw(s) as *mut (Any + Send))
         })
     }
 }
@@ -643,7 +643,7 @@ impl<A, F> FnBox<A> for F
 
 #[unstable(feature = "fnbox",
            reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
-impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + 'a> {
+impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {
     type Output = R;
 
     extern "rust-call" fn call_once(self, args: A) -> R {
@@ -653,7 +653,7 @@ impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + 'a> {
 
 #[unstable(feature = "fnbox",
            reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
-impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + Send + 'a> {
+impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + Send + 'a> {
     type Output = R;
 
     extern "rust-call" fn call_once(self, args: A) -> R {