Skip to content

Commit abcfc56

Browse files
committed
Deny broken intra-doc links in linkchecker
Since rustdoc isn't warning about these links, check for them manually.
1 parent a0df7f6 commit abcfc56

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

core/src/alloc/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ impl fmt::Display for AllocError {
8989
pub unsafe trait AllocRef {
9090
/// Attempts to allocate a block of memory.
9191
///
92-
/// On success, returns a [`NonNull<[u8]>`] meeting the size and alignment guarantees of `layout`.
92+
/// On success, returns a [`NonNull<[u8]>`][NonNull] meeting the size and alignment guarantees of `layout`.
9393
///
9494
/// The returned block may have a larger size than specified by `layout.size()`, and may or may
9595
/// not have its contents initialized.
9696
///
97-
/// [`NonNull<[u8]>`]: NonNull
98-
///
9997
/// # Errors
10098
///
10199
/// Returning `Err` indicates that either memory is exhausted or `layout` does not meet
@@ -146,7 +144,7 @@ pub unsafe trait AllocRef {
146144

147145
/// Attempts to extend the memory block.
148146
///
149-
/// Returns a new [`NonNull<[u8]>`] containing a pointer and the actual size of the allocated
147+
/// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
150148
/// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish
151149
/// this, the allocator may extend the allocation referenced by `ptr` to fit the new layout.
152150
///
@@ -158,8 +156,6 @@ pub unsafe trait AllocRef {
158156
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
159157
/// this allocator, and the contents of the memory block are unaltered.
160158
///
161-
/// [`NonNull<[u8]>`]: NonNull
162-
///
163159
/// # Safety
164160
///
165161
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator.
@@ -271,7 +267,7 @@ pub unsafe trait AllocRef {
271267

272268
/// Attempts to shrink the memory block.
273269
///
274-
/// Returns a new [`NonNull<[u8]>`] containing a pointer and the actual size of the allocated
270+
/// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
275271
/// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish
276272
/// this, the allocator may shrink the allocation referenced by `ptr` to fit the new layout.
277273
///
@@ -283,8 +279,6 @@ pub unsafe trait AllocRef {
283279
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
284280
/// this allocator, and the contents of the memory block are unaltered.
285281
///
286-
/// [`NonNull<[u8]>`]: NonNull
287-
///
288282
/// # Safety
289283
///
290284
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator.

core/src/convert/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pub const fn identity<T>(x: T) -> T {
134134
/// want to accept all references that can be converted to [`&str`] as an argument.
135135
/// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument.
136136
///
137+
/// [`&str`]: primitive@str
137138
/// [`Option<T>`]: Option
138139
/// [`Result<T, E>`]: Result
139140
/// [`Borrow`]: crate::borrow::Borrow

core/src/iter/traits/double_ended.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ pub trait DoubleEndedIterator: Iterator {
122122
/// assert_eq!(iter.advance_back_by(0), Ok(()));
123123
/// assert_eq!(iter.advance_back_by(100), Err(1)); // only `&3` was skipped
124124
/// ```
125+
///
126+
/// [`Ok(())`]: Ok
127+
/// [`Err(k)`]: Err
125128
#[inline]
126129
#[unstable(feature = "iter_advance_by", reason = "recently added", issue = "77404")]
127130
fn advance_back_by(&mut self, n: usize) -> Result<(), usize> {

core/src/iter/traits/iterator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ pub trait Iterator {
289289
/// This method will eagerly skip `n` elements by calling [`next`] up to `n`
290290
/// times until [`None`] is encountered.
291291
///
292-
/// `advance_by(n)` will return [`Ok(())`] if the iterator successfully advances by
293-
/// `n` elements, or [`Err(k)`] if [`None`] is encountered, where `k` is the number
292+
/// `advance_by(n)` will return [`Ok(())`][Ok] if the iterator successfully advances by
293+
/// `n` elements, or [`Err(k)`][Err] if [`None`] is encountered, where `k` is the number
294294
/// of elements the iterator is advanced by before running out of elements (i.e. the
295295
/// length of the iterator). Note that `k` is always less than `n`.
296296
///
297-
/// Calling `advance_by(0)` does not consume any elements and always returns [`Ok(())`].
297+
/// Calling `advance_by(0)` does not consume any elements and always returns [`Ok(())`][Ok].
298298
///
299299
/// [`next`]: Iterator::next
300300
///

core/src/option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ impl<T> Option<T> {
687687
/// assert_eq!(Some(4).filter(is_even), Some(4));
688688
/// ```
689689
///
690+
/// [`Some(t)`]: Some
690691
#[inline]
691692
#[stable(feature = "option_filter", since = "1.27.0")]
692693
pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self {

std/src/ffi/c_str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,8 @@ impl CStr {
13831383
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
13841384
/// [`Cow`]`::`[`Owned`]`(`[`String`]`)` with the result.
13851385
///
1386-
/// [`str`]: prim@str
1386+
/// [`str`]: primitive@str
1387+
/// [`&str`]: primitive@str
13871388
/// [`Borrowed`]: Cow::Borrowed
13881389
/// [`Owned`]: Cow::Owned
13891390
/// [U+FFFD]: crate::char::REPLACEMENT_CHARACTER

0 commit comments

Comments
 (0)