Skip to content

Commit 6d0890e

Browse files
authored
Rollup merge of #76845 - Amjad50:fix-intra-docs-links, r=jyn514
Use intra docs links in core::{ascii, option, str, pattern, hash::map} Partial fix for #75080 @rustbot modify labels: T-doc A-intra-doc-links r? @jyn514
2 parents a815184 + 878dfa6 commit 6d0890e

File tree

5 files changed

+6
-29
lines changed

5 files changed

+6
-29
lines changed

Diff for: library/core/src/ascii.rs

-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//!
77
//! The [`escape_default`] function provides an iterator over the bytes of an
88
//! escaped version of the character given.
9-
//!
10-
//! [`escape_default`]: fn.escape_default.html
119
1210
#![stable(feature = "core_ascii", since = "1.26.0")]
1311

@@ -20,8 +18,6 @@ use crate::str::from_utf8_unchecked;
2018
///
2119
/// This `struct` is created by the [`escape_default`] function. See its
2220
/// documentation for more.
23-
///
24-
/// [`escape_default`]: fn.escape_default.html
2521
#[stable(feature = "rust1", since = "1.0.0")]
2622
#[derive(Clone)]
2723
pub struct EscapeDefault {

Diff for: library/core/src/option.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1502,8 +1502,6 @@ unsafe impl<A> TrustedLen for IterMut<'_, A> {}
15021502
/// The iterator yields one value if the [`Option`] is a [`Some`], otherwise none.
15031503
///
15041504
/// This `struct` is created by the [`Option::into_iter`] function.
1505-
///
1506-
/// [`Option::into_iter`]: enum.Option.html#method.into_iter
15071505
#[derive(Clone, Debug)]
15081506
#[stable(feature = "rust1", since = "1.0.0")]
15091507
pub struct IntoIter<A> {

Diff for: library/core/src/str/mod.rs

+5-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! For more details, see the [`std::str`] module.
66
//!
7-
//! [`std::str`]: self
7+
//! [`std::str`]: ../../std/str/index.html
88
99
#![stable(feature = "rust1", since = "1.0.0")]
1010

@@ -84,9 +84,6 @@ pub trait FromStr: Sized {
8484
/// when the string is ill-formatted return an error specific to the
8585
/// inside [`Err`]. The error type is specific to implementation of the trait.
8686
///
87-
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
88-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
89-
///
9087
/// # Examples
9188
///
9289
/// Basic usage with [`i32`][ithirtytwo], a type that implements `FromStr`:
@@ -269,11 +266,9 @@ impl Utf8Error {
269266
///
270267
/// If you are sure that the byte slice is valid UTF-8, and you don't want to
271268
/// incur the overhead of the validity check, there is an unsafe version of
272-
/// this function, [`from_utf8_unchecked`][fromutf8u], which has the same
269+
/// this function, [`from_utf8_unchecked`], which has the same
273270
/// behavior but skips the check.
274271
///
275-
/// [fromutf8u]: fn.from_utf8_unchecked.html
276-
///
277272
/// If you need a `String` instead of a `&str`, consider
278273
/// [`String::from_utf8`][string].
279274
///
@@ -318,11 +313,9 @@ impl Utf8Error {
318313
/// assert!(str::from_utf8(&sparkle_heart).is_err());
319314
/// ```
320315
///
321-
/// See the docs for [`Utf8Error`][error] for more details on the kinds of
316+
/// See the docs for [`Utf8Error`] for more details on the kinds of
322317
/// errors that can be returned.
323318
///
324-
/// [error]: struct.Utf8Error.html
325-
///
326319
/// A "stack allocated string":
327320
///
328321
/// ```
@@ -371,10 +364,8 @@ pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
371364
///
372365
/// assert!(str::from_utf8_mut(&mut invalid).is_err());
373366
/// ```
374-
/// See the docs for [`Utf8Error`][error] for more details on the kinds of
367+
/// See the docs for [`Utf8Error`] for more details on the kinds of
375368
/// errors that can be returned.
376-
///
377-
/// [error]: struct.Utf8Error.html
378369
#[stable(feature = "str_mut_extras", since = "1.20.0")]
379370
pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
380371
run_utf8_validation(v)?;
@@ -385,9 +376,7 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
385376
/// Converts a slice of bytes to a string slice without checking
386377
/// that the string contains valid UTF-8.
387378
///
388-
/// See the safe version, [`from_utf8`][fromutf8], for more information.
389-
///
390-
/// [fromutf8]: fn.from_utf8.html
379+
/// See the safe version, [`from_utf8`], for more information.
391380
///
392381
/// # Safety
393382
///

Diff for: library/core/src/str/pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//! assert_eq!(s.find(|c: char| c.is_ascii_punctuation()), Some(35));
2929
//! ```
3030
//!
31-
//! [pattern-impls]: trait.Pattern.html#implementors
31+
//! [pattern-impls]: Pattern#implementors
3232
3333
#![unstable(
3434
feature = "pattern",

Diff for: library/std/src/collections/hash/map.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1298,9 +1298,7 @@ pub struct RawEntryBuilderMut<'a, K: 'a, V: 'a, S: 'a> {
12981298
/// This `enum` is constructed through the [`raw_entry_mut`] method on [`HashMap`],
12991299
/// then calling one of the methods of that [`RawEntryBuilderMut`].
13001300
///
1301-
/// [`Entry`]: enum.Entry.html
13021301
/// [`raw_entry_mut`]: HashMap::raw_entry_mut
1303-
/// [`RawEntryBuilderMut`]: struct.RawEntryBuilderMut.html
13041302
#[unstable(feature = "hash_raw_entry", issue = "56167")]
13051303
pub enum RawEntryMut<'a, K: 'a, V: 'a, S: 'a> {
13061304
/// An occupied entry.
@@ -1705,8 +1703,6 @@ impl<K: Debug, V: Debug> Debug for Entry<'_, K, V> {
17051703

17061704
/// A view into an occupied entry in a `HashMap`.
17071705
/// It is part of the [`Entry`] enum.
1708-
///
1709-
/// [`Entry`]: enum.Entry.html
17101706
#[stable(feature = "rust1", since = "1.0.0")]
17111707
pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
17121708
base: base::RustcOccupiedEntry<'a, K, V>,
@@ -1721,8 +1717,6 @@ impl<K: Debug, V: Debug> Debug for OccupiedEntry<'_, K, V> {
17211717

17221718
/// A view into a vacant entry in a `HashMap`.
17231719
/// It is part of the [`Entry`] enum.
1724-
///
1725-
/// [`Entry`]: enum.Entry.html
17261720
#[stable(feature = "rust1", since = "1.0.0")]
17271721
pub struct VacantEntry<'a, K: 'a, V: 'a> {
17281722
base: base::RustcVacantEntry<'a, K, V>,

0 commit comments

Comments
 (0)