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,7 @@ 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
+ /// [`exit`]: crate::process::exit
105
103
///
106
104
/// # `!` and generics
107
105
///
@@ -185,14 +183,12 @@ mod prim_bool {}
185
183
/// ever stops, it means that an error occurred. We don't even have to wrap the loop in an `Ok`
186
184
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
187
185
///
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
196
192
///
197
193
/// # `!` and traits
198
194
///
@@ -233,11 +229,9 @@ mod prim_bool {}
233
229
/// `impl` for this which simply panics, but the same is true for any type (we could `impl
234
230
/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
235
231
///
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
241
235
///
242
236
#[ unstable( feature = "never_type" , issue = "35121" ) ]
243
237
mod prim_never { }
@@ -360,7 +354,7 @@ mod prim_unit {}
360
354
//
361
355
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
362
356
///
363
- /// *[See also the `std::ptr` module]( ptr/index.html) .*
357
+ /// *[See also the `std::ptr` module][`crate:: ptr`] .*
364
358
///
365
359
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
366
360
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
@@ -439,13 +433,13 @@ mod prim_unit {}
439
433
/// but C APIs hand out a lot of pointers generally, so are a common source
440
434
/// of raw pointers in Rust.
441
435
///
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
444
438
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
445
439
/// [`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
449
443
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
450
444
mod prim_pointer { }
451
445
@@ -458,32 +452,32 @@ mod prim_pointer {}
458
452
///
459
453
/// * A list with each element, i.e., `[x, y, z]`.
460
454
/// * 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`].
462
456
///
463
457
/// Arrays of *any* size implement the following traits if the element type allows it:
464
458
///
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`]
471
465
///
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
473
467
/// if the element type allows it. As a stopgap, trait implementations are
474
468
/// statically generated up to size 32.
475
469
///
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
479
473
/// to the compiler.
480
474
///
481
475
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
482
476
/// an array. Indeed, this provides most of the API for working with arrays.
483
477
/// Slices have a dynamic size and do not coerce to arrays.
484
478
///
485
479
/// 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`].
487
481
///
488
482
/// # Examples
489
483
///
@@ -535,22 +529,10 @@ mod prim_pointer {}
535
529
/// ```
536
530
///
537
531
/// [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
554
536
///
555
537
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
556
538
mod prim_array { }
@@ -563,7 +545,7 @@ mod prim_array {}
563
545
/// means that elements are laid out so that every element is the same
564
546
/// distance from its neighbors.
565
547
///
566
- /// *[See also the `std::slice` module]( slice/index.html) .*
548
+ /// *[See also the `std::slice` module][`crate:: slice`] .*
567
549
///
568
550
/// Slices are a view into a block of memory represented as a pointer and a
569
551
/// length.
@@ -608,7 +590,7 @@ mod prim_slice {}
608
590
//
609
591
/// String slices.
610
592
///
611
- /// *[See also the `std::str` module]( str/index.html) .*
593
+ /// *[See also the `std::str` module][`crate:: str`] .*
612
594
///
613
595
/// The `str` type, also called a 'string slice', is the most primitive string
614
596
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
@@ -729,15 +711,8 @@ mod prim_str {}
729
711
/// * [`Default`]
730
712
/// * [`Hash`]
731
713
///
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
741
716
///
742
717
/// Due to a temporary restriction in Rust's type system, these traits are only
743
718
/// implemented on tuples of arity 12 or less. In the future, this may change.
@@ -810,7 +785,7 @@ mod prim_tuple {}
810
785
///
811
786
/// For more information on floating point numbers, see [Uncyclopedia][wikipedia].
812
787
///
813
- /// *[See also the `std::f32::consts` module]( f32/ consts/index.html) .*
788
+ /// *[See also the `std::f32::consts` module][`crate:: f32:: consts`] .*
814
789
///
815
790
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
816
791
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -819,12 +794,12 @@ mod prim_f32 {}
819
794
#[ doc( primitive = "f64" ) ]
820
795
/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
821
796
///
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
823
798
/// precision by using twice as many bits. Please see [the documentation for
824
- /// `f32`](primitive.f32.html) or [Uncyclopedia on double precision
799
+ /// `f32`] or [Uncyclopedia on double precision
825
800
/// values][wikipedia] for more information.
826
801
///
827
- /// *[See also the `std::f64::consts` module]( f64/ consts/index.html) .*
802
+ /// *[See also the `std::f64::consts` module][`crate:: f64:: consts`] .*
828
803
///
829
804
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
830
805
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -945,9 +920,6 @@ mod prim_usize {}
945
920
/// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while
946
921
/// [`PartialEq`] compares values.
947
922
///
948
- /// [`ptr::eq`]: ptr/fn.eq.html
949
- /// [`PartialEq`]: cmp/trait.PartialEq.html
950
- ///
951
923
/// ```
952
924
/// use std::ptr;
953
925
///
@@ -979,11 +951,9 @@ mod prim_usize {}
979
951
/// * [`Borrow`]
980
952
/// * [`Pointer`]
981
953
///
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
987
957
///
988
958
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
989
959
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -992,8 +962,8 @@ mod prim_usize {}
992
962
/// * [`DerefMut`]
993
963
/// * [`BorrowMut`]
994
964
///
995
- /// [`DerefMut`]: ops/trait. DerefMut.html
996
- /// [`BorrowMut`]: borrow/trait. BorrowMut.html
965
+ /// [`DerefMut`]: ops:: DerefMut
966
+ /// [`BorrowMut`]: borrow:: BorrowMut
997
967
///
998
968
/// The following traits are implemented on `&T` references if the underlying `T` also implements
999
969
/// that trait:
@@ -1008,18 +978,10 @@ mod prim_usize {}
1008
978
/// * [`Hash`]
1009
979
/// * [`ToSocketAddrs`]
1010
980
///
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
1023
985
///
1024
986
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
1025
987
/// implements that trait:
@@ -1038,17 +1000,11 @@ mod prim_usize {}
1038
1000
/// * [`Seek`]
1039
1001
/// * [`BufRead`]
1040
1002
///
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
1052
1008
///
1053
1009
/// Note that due to method call deref coercion, simply calling a trait method will act like they
1054
1010
/// work on references as well as they do on owned values! The implementations described here are
@@ -1063,9 +1019,9 @@ mod prim_ref {}
1063
1019
///
1064
1020
/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
1065
1021
///
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
1069
1025
///
1070
1026
/// Function pointers are pointers that point to *code*, not data. They can be called
1071
1027
/// just like functions. Like references, function pointers are, among other things, assumed to
@@ -1177,14 +1133,8 @@ mod prim_ref {}
1177
1133
/// * [`Pointer`]
1178
1134
/// * [`Debug`]
1179
1135
///
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
1188
1138
///
1189
1139
/// Due to a temporary restriction in Rust's type system, these traits are only implemented on
1190
1140
/// functions that take 12 arguments or less, with the `"Rust"` and `"C"` ABIs. In the future, this
@@ -1193,7 +1143,5 @@ mod prim_ref {}
1193
1143
/// In addition, function pointers of *any* signature, ABI, or safety are [`Copy`], and all *safe*
1194
1144
/// function pointers implement [`Fn`], [`FnMut`], and [`FnOnce`]. This works because these traits
1195
1145
/// are specially known to the compiler.
1196
- ///
1197
- /// [`Copy`]: marker/trait.Copy.html
1198
1146
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1199
1147
mod prim_fn { }
0 commit comments