Skip to content

Commit 027b2f1

Browse files
authored
Rollup merge of #75832 - kofls:intradoc-fix, r=jyn514
Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs… …, primitive_docs.rs & poison.rs Partial fix for #75080 r? @jyn514
2 parents 5c27700 + 7569cf9 commit 027b2f1

File tree

4 files changed

+76
-172
lines changed

4 files changed

+76
-172
lines changed

library/std/src/primitive_docs.rs

+67-117
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
/// assert!(!bool_val);
2121
/// ```
2222
///
23-
/// [`assert!`]: macro.assert.html
24-
/// [`BitAnd`]: ops/trait.BitAnd.html
25-
/// [`BitOr`]: ops/trait.BitOr.html
26-
/// [`Not`]: ops/trait.Not.html
23+
/// [`BitAnd`]: ops::BitAnd
24+
/// [`BitOr`]: ops::BitOr
25+
/// [`Not`]: ops::Not
2726
///
2827
/// # Examples
2928
///
@@ -46,7 +45,7 @@
4645
/// }
4746
/// ```
4847
///
49-
/// Also, since `bool` implements the [`Copy`](marker/trait.Copy.html) trait, we don't
48+
/// Also, since `bool` implements the [`Copy`] trait, we don't
5049
/// have to worry about the move semantics (just like the integer and float primitives).
5150
///
5251
/// Now an example of `bool` cast to integer type:
@@ -100,8 +99,8 @@ mod prim_bool {}
10099
/// at all we know it can never produce a value which isn't a [`u32`]. This illustrates another
101100
/// behaviour of the `!` type - expressions with type `!` will coerce into any other type.
102101
///
103-
/// [`u32`]: primitive.str.html
104-
/// [`exit`]: process/fn.exit.html
102+
/// [`u32`]: prim@u32
103+
/// [`exit`]: process::exit
105104
///
106105
/// # `!` and generics
107106
///
@@ -185,14 +184,12 @@ mod prim_bool {}
185184
/// ever stops, it means that an error occurred. We don't even have to wrap the loop in an `Ok`
186185
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
187186
///
188-
/// [`String::from_str`]: str/trait.FromStr.html#tymethod.from_str
189-
/// [`Result<String, !>`]: result/enum.Result.html
190-
/// [`Result<T, !>`]: result/enum.Result.html
191-
/// [`Result<!, E>`]: result/enum.Result.html
192-
/// [`Ok`]: result/enum.Result.html#variant.Ok
193-
/// [`String`]: string/struct.String.html
194-
/// [`Err`]: result/enum.Result.html#variant.Err
195-
/// [`FromStr`]: str/trait.FromStr.html
187+
/// [`String::from_str`]: str::FromStr::from_str
188+
/// [`Result<String, !>`]: Result
189+
/// [`Result<T, !>`]: Result
190+
/// [`Result<!, E>`]: Result
191+
/// [`String`]: string::String
192+
/// [`FromStr`]: str::FromStr
196193
///
197194
/// # `!` and traits
198195
///
@@ -233,11 +230,9 @@ mod prim_bool {}
233230
/// `impl` for this which simply panics, but the same is true for any type (we could `impl
234231
/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
235232
///
236-
/// [`fmt::Result`]: fmt/type.Result.html
237-
/// [`File`]: fs/struct.File.html
238-
/// [`Debug`]: fmt/trait.Debug.html
239-
/// [`Default`]: default/trait.Default.html
240-
/// [`default()`]: default/trait.Default.html#tymethod.default
233+
/// [`File`]: fs::File
234+
/// [`Debug`]: fmt::Debug
235+
/// [`default()`]: Default::default
241236
///
242237
#[unstable(feature = "never_type", issue = "35121")]
243238
mod prim_never {}
@@ -360,7 +355,7 @@ mod prim_unit {}
360355
//
361356
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
362357
///
363-
/// *[See also the `std::ptr` module](ptr/index.html).*
358+
/// *[See also the `std::ptr` module][`ptr`].*
364359
///
365360
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
366361
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
@@ -439,13 +434,13 @@ mod prim_unit {}
439434
/// but C APIs hand out a lot of pointers generally, so are a common source
440435
/// of raw pointers in Rust.
441436
///
442-
/// [`null`]: ../std/ptr/fn.null.html
443-
/// [`null_mut`]: ../std/ptr/fn.null_mut.html
437+
/// [`null`]: ptr::null
438+
/// [`null_mut`]: ptr::null_mut
444439
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
445440
/// [`offset`]: ../std/primitive.pointer.html#method.offset
446-
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
447-
/// [`drop`]: ../std/mem/fn.drop.html
448-
/// [`write`]: ../std/ptr/fn.write.html
441+
/// [`into_raw`]: Box::into_raw
442+
/// [`drop`]: mem::drop
443+
/// [`write`]: ptr::write
449444
#[stable(feature = "rust1", since = "1.0.0")]
450445
mod prim_pointer {}
451446

@@ -458,32 +453,32 @@ mod prim_pointer {}
458453
///
459454
/// * A list with each element, i.e., `[x, y, z]`.
460455
/// * A repeat expression `[x; N]`, which produces an array with `N` copies of `x`.
461-
/// The type of `x` must be [`Copy`][copy].
456+
/// The type of `x` must be [`Copy`].
462457
///
463458
/// Arrays of *any* size implement the following traits if the element type allows it:
464459
///
465-
/// - [`Debug`][debug]
466-
/// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`)
467-
/// - [`PartialEq`][partialeq], [`PartialOrd`][partialord], [`Eq`][eq], [`Ord`][ord]
468-
/// - [`Hash`][hash]
469-
/// - [`AsRef`][asref], [`AsMut`][asmut]
470-
/// - [`Borrow`][borrow], [`BorrowMut`][borrowmut]
460+
/// - [`Debug`]
461+
/// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
462+
/// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
463+
/// - [`Hash`]
464+
/// - [`AsRef`], [`AsMut`]
465+
/// - [`Borrow`], [`BorrowMut`]
471466
///
472-
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`][default] trait
467+
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`] trait
473468
/// if the element type allows it. As a stopgap, trait implementations are
474469
/// statically generated up to size 32.
475470
///
476-
/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy]
477-
/// and [`Clone`][clone] if the element type is [`Clone`][clone]. This works
478-
/// because [`Copy`][copy] and [`Clone`][clone] traits are specially known
471+
/// Arrays of *any* size are [`Copy`] if the element type is [`Copy`]
472+
/// and [`Clone`] if the element type is [`Clone`]. This works
473+
/// because [`Copy`] and [`Clone`] traits are specially known
479474
/// to the compiler.
480475
///
481476
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
482477
/// an array. Indeed, this provides most of the API for working with arrays.
483478
/// Slices have a dynamic size and do not coerce to arrays.
484479
///
485480
/// You can move elements out of an array with a slice pattern. If you want
486-
/// one element, see [`mem::replace`][replace].
481+
/// one element, see [`mem::replace`].
487482
///
488483
/// # Examples
489484
///
@@ -535,22 +530,10 @@ mod prim_pointer {}
535530
/// ```
536531
///
537532
/// [slice]: primitive.slice.html
538-
/// [copy]: marker/trait.Copy.html
539-
/// [clone]: clone/trait.Clone.html
540-
/// [debug]: fmt/trait.Debug.html
541-
/// [intoiterator]: iter/trait.IntoIterator.html
542-
/// [partialeq]: cmp/trait.PartialEq.html
543-
/// [partialord]: cmp/trait.PartialOrd.html
544-
/// [eq]: cmp/trait.Eq.html
545-
/// [ord]: cmp/trait.Ord.html
546-
/// [hash]: hash/trait.Hash.html
547-
/// [asref]: convert/trait.AsRef.html
548-
/// [asmut]: convert/trait.AsMut.html
549-
/// [borrow]: borrow/trait.Borrow.html
550-
/// [borrowmut]: borrow/trait.BorrowMut.html
551-
/// [default]: default/trait.Default.html
552-
/// [replace]: mem/fn.replace.html
553-
/// [`IntoIterator`]: iter/trait.IntoIterator.html
533+
/// [`Debug`]: fmt::Debug
534+
/// [`Hash`]: hash::Hash
535+
/// [`Borrow`]: borrow::Borrow
536+
/// [`BorrowMut`]: borrow::BorrowMut
554537
///
555538
#[stable(feature = "rust1", since = "1.0.0")]
556539
mod prim_array {}
@@ -563,7 +546,7 @@ mod prim_array {}
563546
/// means that elements are laid out so that every element is the same
564547
/// distance from its neighbors.
565548
///
566-
/// *[See also the `std::slice` module](slice/index.html).*
549+
/// *[See also the `std::slice` module][`crate::slice`].*
567550
///
568551
/// Slices are a view into a block of memory represented as a pointer and a
569552
/// length.
@@ -608,7 +591,7 @@ mod prim_slice {}
608591
//
609592
/// String slices.
610593
///
611-
/// *[See also the `std::str` module](str/index.html).*
594+
/// *[See also the `std::str` module][`crate::str`].*
612595
///
613596
/// The `str` type, also called a 'string slice', is the most primitive string
614597
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
@@ -660,8 +643,8 @@ mod prim_slice {}
660643
/// assert_eq!(s, Ok(story));
661644
/// ```
662645
///
663-
/// [`as_ptr`]: #method.as_ptr
664-
/// [`len`]: #method.len
646+
/// [`as_ptr`]: str::as_ptr
647+
/// [`len`]: str::len
665648
///
666649
/// Note: This example shows the internals of `&str`. `unsafe` should not be
667650
/// used to get a string slice under normal circumstances. Use `as_str`
@@ -729,15 +712,8 @@ mod prim_str {}
729712
/// * [`Default`]
730713
/// * [`Hash`]
731714
///
732-
/// [`Clone`]: clone/trait.Clone.html
733-
/// [`Copy`]: marker/trait.Copy.html
734-
/// [`PartialEq`]: cmp/trait.PartialEq.html
735-
/// [`Eq`]: cmp/trait.Eq.html
736-
/// [`PartialOrd`]: cmp/trait.PartialOrd.html
737-
/// [`Ord`]: cmp/trait.Ord.html
738-
/// [`Debug`]: fmt/trait.Debug.html
739-
/// [`Default`]: default/trait.Default.html
740-
/// [`Hash`]: hash/trait.Hash.html
715+
/// [`Debug`]: fmt::Debug
716+
/// [`Hash`]: hash::Hash
741717
///
742718
/// Due to a temporary restriction in Rust's type system, these traits are only
743719
/// implemented on tuples of arity 12 or less. In the future, this may change.
@@ -810,7 +786,7 @@ mod prim_tuple {}
810786
///
811787
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
812788
///
813-
/// *[See also the `std::f32::consts` module](f32/consts/index.html).*
789+
/// *[See also the `std::f32::consts` module][`crate::f32::consts`].*
814790
///
815791
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
816792
#[stable(feature = "rust1", since = "1.0.0")]
@@ -819,13 +795,14 @@ mod prim_f32 {}
819795
#[doc(primitive = "f64")]
820796
/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
821797
///
822-
/// This type is very similar to [`f32`](primitive.f32.html), but has increased
798+
/// This type is very similar to [`f32`], but has increased
823799
/// precision by using twice as many bits. Please see [the documentation for
824-
/// `f32`](primitive.f32.html) or [Wikipedia on double precision
800+
/// `f32`][`f32`] or [Wikipedia on double precision
825801
/// values][wikipedia] for more information.
826802
///
827-
/// *[See also the `std::f64::consts` module](f64/consts/index.html).*
803+
/// *[See also the `std::f64::consts` module][`crate::f64::consts`].*
828804
///
805+
/// [`f32`]: prim@f32
829806
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
830807
#[stable(feature = "rust1", since = "1.0.0")]
831808
mod prim_f64 {}
@@ -945,9 +922,6 @@ mod prim_usize {}
945922
/// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while
946923
/// [`PartialEq`] compares values.
947924
///
948-
/// [`ptr::eq`]: ptr/fn.eq.html
949-
/// [`PartialEq`]: cmp/trait.PartialEq.html
950-
///
951925
/// ```
952926
/// use std::ptr;
953927
///
@@ -979,11 +953,9 @@ mod prim_usize {}
979953
/// * [`Borrow`]
980954
/// * [`Pointer`]
981955
///
982-
/// [`Copy`]: marker/trait.Copy.html
983-
/// [`Clone`]: clone/trait.Clone.html
984-
/// [`Deref`]: ops/trait.Deref.html
985-
/// [`Borrow`]: borrow/trait.Borrow.html
986-
/// [`Pointer`]: fmt/trait.Pointer.html
956+
/// [`Deref`]: ops::Deref
957+
/// [`Borrow`]: borrow::Borrow
958+
/// [`Pointer`]: fmt::Pointer
987959
///
988960
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
989961
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -992,8 +964,8 @@ mod prim_usize {}
992964
/// * [`DerefMut`]
993965
/// * [`BorrowMut`]
994966
///
995-
/// [`DerefMut`]: ops/trait.DerefMut.html
996-
/// [`BorrowMut`]: borrow/trait.BorrowMut.html
967+
/// [`DerefMut`]: ops::DerefMut
968+
/// [`BorrowMut`]: borrow::BorrowMut
997969
///
998970
/// The following traits are implemented on `&T` references if the underlying `T` also implements
999971
/// that trait:
@@ -1008,18 +980,10 @@ mod prim_usize {}
1008980
/// * [`Hash`]
1009981
/// * [`ToSocketAddrs`]
1010982
///
1011-
/// [`std::fmt`]: fmt/index.html
1012-
/// [`fmt::Write`]: fmt/trait.Write.html
1013-
/// [`PartialOrd`]: cmp/trait.PartialOrd.html
1014-
/// [`Ord`]: cmp/trait.Ord.html
1015-
/// [`PartialEq`]: cmp/trait.PartialEq.html
1016-
/// [`Eq`]: cmp/trait.Eq.html
1017-
/// [`AsRef`]: convert/trait.AsRef.html
1018-
/// [`Fn`]: ops/trait.Fn.html
1019-
/// [`FnMut`]: ops/trait.FnMut.html
1020-
/// [`FnOnce`]: ops/trait.FnOnce.html
1021-
/// [`Hash`]: hash/trait.Hash.html
1022-
/// [`ToSocketAddrs`]: net/trait.ToSocketAddrs.html
983+
/// [`std::fmt`]: fmt
984+
/// ['Pointer`]: fmt::Pointer
985+
/// [`Hash`]: hash::Hash
986+
/// [`ToSocketAddrs`]: net::ToSocketAddrs
1023987
///
1024988
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
1025989
/// implements that trait:
@@ -1038,17 +1002,11 @@ mod prim_usize {}
10381002
/// * [`Seek`]
10391003
/// * [`BufRead`]
10401004
///
1041-
/// [`AsMut`]: convert/trait.AsMut.html
1042-
/// [`Iterator`]: iter/trait.Iterator.html
1043-
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
1044-
/// [`ExactSizeIterator`]: iter/trait.ExactSizeIterator.html
1045-
/// [`FusedIterator`]: iter/trait.FusedIterator.html
1046-
/// [`TrustedLen`]: iter/trait.TrustedLen.html
1047-
/// [`Send`]: marker/trait.Send.html
1048-
/// [`io::Write`]: io/trait.Write.html
1049-
/// [`Read`]: io/trait.Read.html
1050-
/// [`Seek`]: io/trait.Seek.html
1051-
/// [`BufRead`]: io/trait.BufRead.html
1005+
/// [`FusedIterator`]: iter::FusedIterator
1006+
/// [`TrustedLen`]: iter::TrustedLen
1007+
/// [`Seek`]: io::Seek
1008+
/// [`BufRead`]: io::BufRead
1009+
/// [`Read`]: io::Read
10521010
///
10531011
/// Note that due to method call deref coercion, simply calling a trait method will act like they
10541012
/// work on references as well as they do on owned values! The implementations described here are
@@ -1063,9 +1021,9 @@ mod prim_ref {}
10631021
///
10641022
/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
10651023
///
1066-
/// [`Fn`]: ops/trait.Fn.html
1067-
/// [`FnMut`]: ops/trait.FnMut.html
1068-
/// [`FnOnce`]: ops/trait.FnOnce.html
1024+
/// [`Fn`]: ops::Fn
1025+
/// [`FnMut`]: ops::FnMut
1026+
/// [`FnOnce`]: ops::FnOnce
10691027
///
10701028
/// Function pointers are pointers that point to *code*, not data. They can be called
10711029
/// just like functions. Like references, function pointers are, among other things, assumed to
@@ -1177,14 +1135,8 @@ mod prim_ref {}
11771135
/// * [`Pointer`]
11781136
/// * [`Debug`]
11791137
///
1180-
/// [`Clone`]: clone/trait.Clone.html
1181-
/// [`PartialEq`]: cmp/trait.PartialEq.html
1182-
/// [`Eq`]: cmp/trait.Eq.html
1183-
/// [`PartialOrd`]: cmp/trait.PartialOrd.html
1184-
/// [`Ord`]: cmp/trait.Ord.html
1185-
/// [`Hash`]: hash/trait.Hash.html
1186-
/// [`Pointer`]: fmt/trait.Pointer.html
1187-
/// [`Debug`]: fmt/trait.Debug.html
1138+
/// [`Hash`]: hash::Hash
1139+
/// [`Pointer`]: fmt::Pointer
11881140
///
11891141
/// Due to a temporary restriction in Rust's type system, these traits are only implemented on
11901142
/// functions that take 12 arguments or less, with the `"Rust"` and `"C"` ABIs. In the future, this
@@ -1193,7 +1145,5 @@ mod prim_ref {}
11931145
/// In addition, function pointers of *any* signature, ABI, or safety are [`Copy`], and all *safe*
11941146
/// function pointers implement [`Fn`], [`FnMut`], and [`FnOnce`]. This works because these traits
11951147
/// are specially known to the compiler.
1196-
///
1197-
/// [`Copy`]: marker/trait.Copy.html
11981148
#[stable(feature = "rust1", since = "1.0.0")]
11991149
mod prim_fn {}

0 commit comments

Comments
 (0)