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///
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,7 @@ 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+ /// [`exit`]: crate::process::exit
105103///
106104/// # `!` and generics
107105///
@@ -185,14 +183,12 @@ mod prim_bool {}
185183/// ever stops, it means that an error occurred. We don't even have to wrap the loop in an `Ok`
186184/// because `!` coerces to `Result<!, ConnectionError>` automatically.
187185///
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
186+ /// [`String::from_str`]: str::FromStr::from_str
187+ /// [`Result<String, !>`]: Result
188+ /// [`Result<T, !>`]: Result
189+ /// [`Result<!, E>`]: Result
190+ /// [`String`]: string::String
191+ /// [`FromStr`]: str::FromStr
196192///
197193/// # `!` and traits
198194///
@@ -233,11 +229,9 @@ mod prim_bool {}
233229/// `impl` for this which simply panics, but the same is true for any type (we could `impl
234230/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
235231///
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
232+ /// [`File`]: fs::File
233+ /// [`Debug`]: fmt::Debug
234+ /// [`default()`]: Default::default
241235///
242236#[ unstable( feature = "never_type" , issue = "35121" ) ]
243237mod prim_never { }
@@ -360,7 +354,7 @@ mod prim_unit {}
360354//
361355/// Raw, unsafe pointers, `*const T`, and `*mut T`.
362356///
363- /// *[See also the `std::ptr` module]( ptr/index.html) .*
357+ /// *[See also the `std::ptr` module][`crate:: ptr`] .*
364358///
365359/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
366360/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
@@ -439,13 +433,13 @@ mod prim_unit {}
439433/// but C APIs hand out a lot of pointers generally, so are a common source
440434/// of raw pointers in Rust.
441435///
442- /// [`null`]: ../std/ ptr/fn. null.html
443- /// [`null_mut`]: ../std/ ptr/fn. null_mut.html
436+ /// [`null`]: ptr:: null
437+ /// [`null_mut`]: ptr:: null_mut
444438/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
445439/// [`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
440+ /// [`into_raw`]: Box:: into_raw
441+ /// [`drop`]: mem:: drop
442+ /// [`write`]: ptr:: write
449443#[ stable( feature = "rust1" , since = "1.0.0" ) ]
450444mod prim_pointer { }
451445
@@ -458,32 +452,32 @@ mod prim_pointer {}
458452///
459453/// * A list with each element, i.e., `[x, y, z]`.
460454/// * A repeat expression `[x; N]`, which produces an array with `N` copies of `x`.
461- /// The type of `x` must be [`Copy`][copy] .
455+ /// The type of `x` must be [`Copy`].
462456///
463457/// Arrays of *any* size implement the following traits if the element type allows it:
464458///
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 ]
459+ /// - [`Debug`]
460+ /// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
461+ /// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
462+ /// - [`Hash`]
463+ /// - [`AsRef`], [`AsMut`]
464+ /// - [`Borrow`], [`BorrowMut`]
471465///
472- /// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`][default] trait
466+ /// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`] trait
473467/// if the element type allows it. As a stopgap, trait implementations are
474468/// statically generated up to size 32.
475469///
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
470+ /// Arrays of *any* size are [`Copy`] if the element type is [`Copy`]
471+ /// and [`Clone`] if the element type is [`Clone`]. This works
472+ /// because [`Copy`] and [`Clone`] traits are specially known
479473/// to the compiler.
480474///
481475/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
482476/// an array. Indeed, this provides most of the API for working with arrays.
483477/// Slices have a dynamic size and do not coerce to arrays.
484478///
485479/// You can move elements out of an array with a slice pattern. If you want
486- /// one element, see [`mem::replace`][replace] .
480+ /// one element, see [`mem::replace`].
487481///
488482/// # Examples
489483///
@@ -535,22 +529,10 @@ mod prim_pointer {}
535529/// ```
536530///
537531/// [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
532+ /// [`Debug`]: fmt::Debug
533+ /// [`Hash`]: hash::Hash
534+ /// [`Borrow`]: borrow::Borrow
535+ /// [`BorrowMut`]: borrow::BorrowMut
554536///
555537#[ stable( feature = "rust1" , since = "1.0.0" ) ]
556538mod prim_array { }
@@ -563,7 +545,7 @@ mod prim_array {}
563545/// means that elements are laid out so that every element is the same
564546/// distance from its neighbors.
565547///
566- /// *[See also the `std::slice` module]( slice/index.html) .*
548+ /// *[See also the `std::slice` module][`crate:: slice`] .*
567549///
568550/// Slices are a view into a block of memory represented as a pointer and a
569551/// length.
@@ -608,7 +590,7 @@ mod prim_slice {}
608590//
609591/// String slices.
610592///
611- /// *[See also the `std::str` module]( str/index.html) .*
593+ /// *[See also the `std::str` module][`crate:: str`] .*
612594///
613595/// The `str` type, also called a 'string slice', is the most primitive string
614596/// type. It is usually seen in its borrowed form, `&str`. It is also the type
@@ -729,15 +711,8 @@ mod prim_str {}
729711/// * [`Default`]
730712/// * [`Hash`]
731713///
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
714+ /// [`Debug`]: fmt::Debug
715+ /// [`Hash`]: hash::Hash
741716///
742717/// Due to a temporary restriction in Rust's type system, these traits are only
743718/// implemented on tuples of arity 12 or less. In the future, this may change.
@@ -810,7 +785,7 @@ mod prim_tuple {}
810785///
811786/// For more information on floating point numbers, see [Wikipedia][wikipedia].
812787///
813- /// *[See also the `std::f32::consts` module]( f32/ consts/index.html) .*
788+ /// *[See also the `std::f32::consts` module][`crate:: f32:: consts`] .*
814789///
815790/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
816791#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -819,12 +794,12 @@ mod prim_f32 {}
819794#[ doc( primitive = "f64" ) ]
820795/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
821796///
822- /// This type is very similar to [`f32`](primitive.f32.html) , but has increased
797+ /// This type is very similar to [`f32`], but has increased
823798/// precision by using twice as many bits. Please see [the documentation for
824- /// `f32`](primitive.f32.html) or [Wikipedia on double precision
799+ /// `f32`] or [Wikipedia on double precision
825800/// values][wikipedia] for more information.
826801///
827- /// *[See also the `std::f64::consts` module]( f64/ consts/index.html) .*
802+ /// *[See also the `std::f64::consts` module][`crate:: f64:: consts`] .*
828803///
829804/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
830805#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -945,9 +920,6 @@ mod prim_usize {}
945920/// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while
946921/// [`PartialEq`] compares values.
947922///
948- /// [`ptr::eq`]: ptr/fn.eq.html
949- /// [`PartialEq`]: cmp/trait.PartialEq.html
950- ///
951923/// ```
952924/// use std::ptr;
953925///
@@ -979,11 +951,9 @@ mod prim_usize {}
979951/// * [`Borrow`]
980952/// * [`Pointer`]
981953///
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
954+ /// [`Deref`]: ops::Deref
955+ /// [`Borrow`]: borrow::Borrow
956+ /// [`Pointer`]: fmt::Pointer
987957///
988958/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
989959/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -992,8 +962,8 @@ mod prim_usize {}
992962/// * [`DerefMut`]
993963/// * [`BorrowMut`]
994964///
995- /// [`DerefMut`]: ops/trait. DerefMut.html
996- /// [`BorrowMut`]: borrow/trait. BorrowMut.html
965+ /// [`DerefMut`]: ops:: DerefMut
966+ /// [`BorrowMut`]: borrow:: BorrowMut
997967///
998968/// The following traits are implemented on `&T` references if the underlying `T` also implements
999969/// that trait:
@@ -1008,18 +978,10 @@ mod prim_usize {}
1008978/// * [`Hash`]
1009979/// * [`ToSocketAddrs`]
1010980///
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
981+ /// [`std::fmt`]: fmt
982+ /// ['Pointer`]: fmt::Pointer
983+ /// [`Hash`]: hash::Hash
984+ /// [`ToSocketAddrs`]: net::ToSocketAddrs
1023985///
1024986/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
1025987/// implements that trait:
@@ -1038,17 +1000,11 @@ mod prim_usize {}
10381000/// * [`Seek`]
10391001/// * [`BufRead`]
10401002///
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
1003+ /// [`FusedIterator`]: iter::FusedIterator
1004+ /// [`TrustedLen`]: iter::TrustedLen
1005+ /// [`Seek`]: io::Seek
1006+ /// [`BufRead`]: io::BufRead
1007+ /// [`Read`]: io::Read
10521008///
10531009/// Note that due to method call deref coercion, simply calling a trait method will act like they
10541010/// work on references as well as they do on owned values! The implementations described here are
@@ -1063,9 +1019,9 @@ mod prim_ref {}
10631019///
10641020/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
10651021///
1066- /// [`Fn`]: ops/trait.Fn.html
1067- /// [`FnMut`]: ops/trait. FnMut.html
1068- /// [`FnOnce`]: ops/trait. FnOnce.html
1022+ /// [`Fn`]: ops::Fn
1023+ /// [`FnMut`]: ops:: FnMut
1024+ /// [`FnOnce`]: ops:: FnOnce
10691025///
10701026/// Function pointers are pointers that point to *code*, not data. They can be called
10711027/// just like functions. Like references, function pointers are, among other things, assumed to
@@ -1177,14 +1133,8 @@ mod prim_ref {}
11771133/// * [`Pointer`]
11781134/// * [`Debug`]
11791135///
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
1136+ /// [`Hash`]: hash::Hash
1137+ /// [`Pointer`]: fmt::Pointer
11881138///
11891139/// Due to a temporary restriction in Rust's type system, these traits are only implemented on
11901140/// functions that take 12 arguments or less, with the `"Rust"` and `"C"` ABIs. In the future, this
@@ -1193,7 +1143,5 @@ mod prim_ref {}
11931143/// In addition, function pointers of *any* signature, ABI, or safety are [`Copy`], and all *safe*
11941144/// function pointers implement [`Fn`], [`FnMut`], and [`FnOnce`]. This works because these traits
11951145/// are specially known to the compiler.
1196- ///
1197- /// [`Copy`]: marker/trait.Copy.html
11981146#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11991147mod prim_fn { }
0 commit comments