diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 1e2c1b2eee67..e6f687ddf963 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -1527,6 +1527,8 @@ impl Box { /// /// The contained value must be of type `T`. Calling this method /// with the incorrect type is *undefined behavior*. + /// + /// [`downcast`]: Self::downcast #[inline] #[unstable(feature = "downcast_unchecked", issue = "90850")] pub unsafe fn downcast_unchecked(self) -> Box { @@ -1584,6 +1586,8 @@ impl Box { /// /// The contained value must be of type `T`. Calling this method /// with the incorrect type is *undefined behavior*. + /// + /// [`downcast`]: Self::downcast #[inline] #[unstable(feature = "downcast_unchecked", issue = "90850")] pub unsafe fn downcast_unchecked(self) -> Box { @@ -1641,6 +1645,8 @@ impl Box { /// /// The contained value must be of type `T`. Calling this method /// with the incorrect type is *undefined behavior*. + /// + /// [`downcast`]: Self::downcast #[inline] #[unstable(feature = "downcast_unchecked", issue = "90850")] pub unsafe fn downcast_unchecked(self) -> Box { diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 3e306b1333a1..72528185707a 100644 --- a/library/core/src/any.rs +++ b/library/core/src/any.rs @@ -265,8 +265,6 @@ impl dyn Any { /// Returns a reference to the inner value as type `dyn T`. /// - /// For a safe alternative see [`downcast_ref`]. - /// /// # Examples /// /// ``` @@ -295,8 +293,6 @@ impl dyn Any { /// Returns a mutable reference to the inner value as type `dyn T`. /// - /// For a safe alternative see [`downcast_mut`]. - /// /// # Examples /// /// ```