about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIbraheem Ahmed <ibrah1440@gmail.com>2021-11-20 18:21:52 -0500
committerIbraheem Ahmed <ibrah1440@gmail.com>2021-11-20 18:22:05 -0500
commit25271a5a98e362fa118672c33e4861cd42e111e9 (patch)
tree94f9924eb76ee4124ff87ffc47dc36a802e252a5
parent6f982930ba2da1ee99c3c4378179bcfe6f615db6 (diff)
downloadrust-25271a5a98e362fa118672c33e4861cd42e111e9.tar.gz
rust-25271a5a98e362fa118672c33e4861cd42e111e9.zip
fix doc links for `downcast_unchecked`
-rw-r--r--library/alloc/src/boxed.rs6
-rw-r--r--library/core/src/any.rs4
2 files changed, 6 insertions, 4 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index 1e2c1b2eee6..e6f687ddf96 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -1527,6 +1527,8 @@ impl<A: Allocator> Box<dyn Any, A> {
     ///
     /// 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<T: Any>(self) -> Box<T, A> {
@@ -1584,6 +1586,8 @@ impl<A: Allocator> Box<dyn Any + Send, A> {
     ///
     /// 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<T: Any>(self) -> Box<T, A> {
@@ -1641,6 +1645,8 @@ impl<A: Allocator> Box<dyn Any + Send + Sync, A> {
     ///
     /// 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<T: Any>(self) -> Box<T, A> {
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index 3e306b1333a..72528185707 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
     ///
     /// ```