/// print_if_string(Box::new(0i8));
/// ```
#[inline]
- #[stable(feature = "box_send_sync_any_downcast", since = "1.51.0")]
+ #[stable(feature = "rust1", since = "1.0.0")]
pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> {
if self.is::<T>() { unsafe { Ok(self.downcast_unchecked::<T>()) } } else { Err(self) }
}
/// print_if_string(Box::new(0i8));
/// ```
#[inline]
- #[stable(feature = "box_send_sync_any_downcast", since = "1.51.0")]
+ #[stable(feature = "rust1", since = "1.0.0")]
pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> {
if self.is::<T>() { unsafe { Ok(self.downcast_unchecked::<T>()) } } else { Err(self) }
}