20
20
/// assert!(!bool_val);
21
21
/// ```
22
22
///
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
27
26
///
28
27
/// # Examples
29
28
///
46
45
/// }
47
46
/// ```
48
47
///
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
50
49
/// have to worry about the move semantics (just like the integer and float primitives).
51
50
///
52
51
/// Now an example of `bool` cast to integer type:
@@ -100,8 +99,8 @@ mod prim_bool {}
100
99
/// at all we know it can never produce a value which isn't a [`u32`]. This illustrates another
101
100
/// behaviour of the `!` type - expressions with type `!` will coerce into any other type.
102
101
///
103
- /// [`u32`]: primitive.str.html
104
- /// [`exit`]: process/fn. exit.html
102
+ /// [`u32`]: prim@u32
103
+ /// [`exit`]: process:: exit
105
104
///
106
105
/// # `!` and generics
107
106
///
@@ -185,14 +184,12 @@ mod prim_bool {}
185
184
/// ever stops, it means that an error occurred. We don't even have to wrap the loop in an `Ok`
186
185
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
187
186
///
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
196
193
///
197
194
/// # `!` and traits
198
195
///
@@ -233,11 +230,9 @@ mod prim_bool {}
233
230
/// `impl` for this which simply panics, but the same is true for any type (we could `impl
234
231
/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
235
232
///
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
241
236
///
242
237
#[ unstable( feature = "never_type" , issue = "35121" ) ]
243
238
mod prim_never { }
@@ -360,7 +355,7 @@ mod prim_unit {}
360
355
//
361
356
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
362
357
///
363
- /// *[See also the `std::ptr` module]( ptr/index.html) .*
358
+ /// *[See also the `std::ptr` module][` ptr`] .*
364
359
///
365
360
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
366
361
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
@@ -439,13 +434,13 @@ mod prim_unit {}
439
434
/// but C APIs hand out a lot of pointers generally, so are a common source
440
435
/// of raw pointers in Rust.
441
436
///
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
444
439
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
445
440
/// [`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
449
444
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
450
445
mod prim_pointer { }
451
446
@@ -458,32 +453,32 @@ mod prim_pointer {}
458
453
///
459
454
/// * A list with each element, i.e., `[x, y, z]`.
460
455
/// * 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`].
462
457
///
463
458
/// Arrays of *any* size implement the following traits if the element type allows it:
464
459
///
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`]
471
466
///
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
473
468
/// if the element type allows it. As a stopgap, trait implementations are
474
469
/// statically generated up to size 32.
475
470
///
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
479
474
/// to the compiler.
480
475
///
481
476
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
482
477
/// an array. Indeed, this provides most of the API for working with arrays.
483
478
/// Slices have a dynamic size and do not coerce to arrays.
484
479
///
485
480
/// 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`].
487
482
///
488
483
/// # Examples
489
484
///
@@ -535,22 +530,10 @@ mod prim_pointer {}
535
530
/// ```
536
531
///
537
532
/// [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
554
537
///
555
538
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
556
539
mod prim_array { }
@@ -563,7 +546,7 @@ mod prim_array {}
563
546
/// means that elements are laid out so that every element is the same
564
547
/// distance from its neighbors.
565
548
///
566
- /// *[See also the `std::slice` module]( slice/index.html) .*
549
+ /// *[See also the `std::slice` module][`crate:: slice`] .*
567
550
///
568
551
/// Slices are a view into a block of memory represented as a pointer and a
569
552
/// length.
@@ -608,7 +591,7 @@ mod prim_slice {}
608
591
//
609
592
/// String slices.
610
593
///
611
- /// *[See also the `std::str` module]( str/index.html) .*
594
+ /// *[See also the `std::str` module][`crate:: str`] .*
612
595
///
613
596
/// The `str` type, also called a 'string slice', is the most primitive string
614
597
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
@@ -660,8 +643,8 @@ mod prim_slice {}
660
643
/// assert_eq!(s, Ok(story));
661
644
/// ```
662
645
///
663
- /// [`as_ptr`]: #method. as_ptr
664
- /// [`len`]: #method. len
646
+ /// [`as_ptr`]: str:: as_ptr
647
+ /// [`len`]: str:: len
665
648
///
666
649
/// Note: This example shows the internals of `&str`. `unsafe` should not be
667
650
/// used to get a string slice under normal circumstances. Use `as_str`
@@ -729,15 +712,8 @@ mod prim_str {}
729
712
/// * [`Default`]
730
713
/// * [`Hash`]
731
714
///
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
741
717
///
742
718
/// Due to a temporary restriction in Rust's type system, these traits are only
743
719
/// implemented on tuples of arity 12 or less. In the future, this may change.
@@ -810,7 +786,7 @@ mod prim_tuple {}
810
786
///
811
787
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
812
788
///
813
- /// *[See also the `std::f32::consts` module]( f32/ consts/index.html) .*
789
+ /// *[See also the `std::f32::consts` module][`crate:: f32:: consts`] .*
814
790
///
815
791
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
816
792
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -819,13 +795,14 @@ mod prim_f32 {}
819
795
#[ doc( primitive = "f64" ) ]
820
796
/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
821
797
///
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
823
799
/// 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
825
801
/// values][wikipedia] for more information.
826
802
///
827
- /// *[See also the `std::f64::consts` module]( f64/ consts/index.html) .*
803
+ /// *[See also the `std::f64::consts` module][`crate:: f64:: consts`] .*
828
804
///
805
+ /// [`f32`]: prim@f32
829
806
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
830
807
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
831
808
mod prim_f64 { }
@@ -945,9 +922,6 @@ mod prim_usize {}
945
922
/// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while
946
923
/// [`PartialEq`] compares values.
947
924
///
948
- /// [`ptr::eq`]: ptr/fn.eq.html
949
- /// [`PartialEq`]: cmp/trait.PartialEq.html
950
- ///
951
925
/// ```
952
926
/// use std::ptr;
953
927
///
@@ -979,11 +953,9 @@ mod prim_usize {}
979
953
/// * [`Borrow`]
980
954
/// * [`Pointer`]
981
955
///
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
987
959
///
988
960
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
989
961
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -992,8 +964,8 @@ mod prim_usize {}
992
964
/// * [`DerefMut`]
993
965
/// * [`BorrowMut`]
994
966
///
995
- /// [`DerefMut`]: ops/trait. DerefMut.html
996
- /// [`BorrowMut`]: borrow/trait. BorrowMut.html
967
+ /// [`DerefMut`]: ops:: DerefMut
968
+ /// [`BorrowMut`]: borrow:: BorrowMut
997
969
///
998
970
/// The following traits are implemented on `&T` references if the underlying `T` also implements
999
971
/// that trait:
@@ -1008,18 +980,10 @@ mod prim_usize {}
1008
980
/// * [`Hash`]
1009
981
/// * [`ToSocketAddrs`]
1010
982
///
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
1023
987
///
1024
988
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
1025
989
/// implements that trait:
@@ -1038,17 +1002,11 @@ mod prim_usize {}
1038
1002
/// * [`Seek`]
1039
1003
/// * [`BufRead`]
1040
1004
///
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
1052
1010
///
1053
1011
/// Note that due to method call deref coercion, simply calling a trait method will act like they
1054
1012
/// work on references as well as they do on owned values! The implementations described here are
@@ -1063,9 +1021,9 @@ mod prim_ref {}
1063
1021
///
1064
1022
/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
1065
1023
///
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
1069
1027
///
1070
1028
/// Function pointers are pointers that point to *code*, not data. They can be called
1071
1029
/// just like functions. Like references, function pointers are, among other things, assumed to
@@ -1177,14 +1135,8 @@ mod prim_ref {}
1177
1135
/// * [`Pointer`]
1178
1136
/// * [`Debug`]
1179
1137
///
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
1188
1140
///
1189
1141
/// Due to a temporary restriction in Rust's type system, these traits are only implemented on
1190
1142
/// functions that take 12 arguments or less, with the `"Rust"` and `"C"` ABIs. In the future, this
@@ -1193,7 +1145,5 @@ mod prim_ref {}
1193
1145
/// In addition, function pointers of *any* signature, ABI, or safety are [`Copy`], and all *safe*
1194
1146
/// function pointers implement [`Fn`], [`FnMut`], and [`FnOnce`]. This works because these traits
1195
1147
/// are specially known to the compiler.
1196
- ///
1197
- /// [`Copy`]: marker/trait.Copy.html
1198
1148
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1199
1149
mod prim_fn { }
0 commit comments