about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKyle Lin <minecraft.kyle.train@gmail.com>2023-07-04 01:51:31 +0800
committerKyle Lin <minecraft.kyle.train@gmail.com>2023-08-18 15:31:32 +0800
commit15ece93e34be62b383c5b67744d8ad68678fb954 (patch)
treecea44c4cb813392b20bbcc5d2880bc84d3f02dc4
parent4896fc0f5919d7facee3ce77e089495cc133dc74 (diff)
downloadrust-15ece93e34be62b383c5b67744d8ad68678fb954.tar.gz
rust-15ece93e34be62b383c5b67744d8ad68678fb954.zip
relax redundancy constraint
-rw-r--r--library/alloc/src/sync.rs6
-rw-r--r--src/librustdoc/passes/lint/redundant_explicit_links.rs7
2 files changed, 3 insertions, 10 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index e2a2fe932ab..476a4fea54f 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -153,7 +153,7 @@ macro_rules! acquire {
 ///
 /// ## `Deref` behavior
 ///
-/// `Arc<T>` automatically dereferences to `T` (via the [`Deref`][deref] trait),
+/// `Arc<T>` automatically dereferences to `T` (via the [`Deref`] trait),
 /// so you can call `T`'s methods on a value of type `Arc<T>`. To avoid name
 /// clashes with `T`'s methods, the methods of `Arc<T>` itself are associated
 /// functions, called using [fully qualified syntax]:
@@ -187,7 +187,6 @@ macro_rules! acquire {
 /// [mutex]: ../../std/sync/struct.Mutex.html
 /// [rwlock]: ../../std/sync/struct.RwLock.html
 /// [atomic]: core::sync::atomic
-/// [deref]: core::ops::Deref
 /// [downgrade]: Arc::downgrade
 /// [upgrade]: Weak::upgrade
 /// [RefCell\<T>]: core::cell::RefCell
@@ -1495,7 +1494,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
     /// alignment as `T`. This is trivially true if `U` is `T`.
     /// Note that if `U` is not `T` but has the same size and alignment, this is
     /// basically like transmuting references of different types. See
-    /// [`mem::transmute`][transmute] for more information on what
+    /// [`mem::transmute`] for more information on what
     /// restrictions apply in this case.
     ///
     /// The raw pointer must point to a block of memory allocated by `alloc`
@@ -1507,7 +1506,6 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
     /// even if the returned `Arc<T>` is never accessed.
     ///
     /// [into_raw]: Arc::into_raw
-    /// [transmute]: core::mem::transmute
     ///
     /// # Examples
     ///
diff --git a/src/librustdoc/passes/lint/redundant_explicit_links.rs b/src/librustdoc/passes/lint/redundant_explicit_links.rs
index da71e537f68..94d07ec034d 100644
--- a/src/librustdoc/passes/lint/redundant_explicit_links.rs
+++ b/src/librustdoc/passes/lint/redundant_explicit_links.rs
@@ -68,7 +68,7 @@ fn check_redundant_explicit_link<'md>(
                 let link_data = collect_link_data(&mut offset_iter);
 
                 if let Some(resolvable_link) = link_data.resolvable_link.as_ref() {
-                    if &link_data.display_link != resolvable_link {
+                    if &link_data.display_link.replace("`", "") != resolvable_link {
                         // Skips if display link does not match to actual
                         // resolvable link, usually happens if display link
                         // has several segments, e.g.
@@ -82,11 +82,6 @@ fn check_redundant_explicit_link<'md>(
                 let explicit_len = explicit_link.len();
                 let display_len = display_link.len();
 
-                if explicit_len == display_len && explicit_link != display_link {
-                    // Skips if they possibly have no relativity.
-                    continue;
-                }
-
                 if (explicit_len >= display_len
                     && &explicit_link[(explicit_len - display_len)..] == display_link)
                     || (display_len >= explicit_len