@@ -148,14 +148,11 @@ use crate::sys;
148
148
/// The easiest way to use `HashMap` with a custom key type is to derive [`Eq`] and [`Hash`].
149
149
/// We must also derive [`PartialEq`].
150
150
///
151
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
152
- /// [`Hash`]: ../../std/hash/trait.Hash.html
153
- /// [`PartialEq`]: ../../std/cmp/trait.PartialEq.html
154
- /// [`RefCell`]: ../../std/cell/struct.RefCell.html
155
- /// [`Cell`]: ../../std/cell/struct.Cell.html
156
- /// [`default`]: #method.default
157
- /// [`with_hasher`]: #method.with_hasher
158
- /// [`with_capacity_and_hasher`]: #method.with_capacity_and_hasher
151
+ /// [`RefCell`]: crate::cell::RefCell
152
+ /// [`Cell`]: crate::cell::Cell
153
+ /// [`default`]: Default::default
154
+ /// [`with_hasher`]: Self::with_hasher
155
+ /// [`with_capacity_and_hasher`]: Self::with_capacity_and_hasher
159
156
/// [`fnv`]: https://crates.io/crates/fnv
160
157
///
161
158
/// ```
@@ -264,8 +261,6 @@ impl<K, V, S> HashMap<K, V, S> {
264
261
/// let mut map = HashMap::with_hasher(s);
265
262
/// map.insert(1, 2);
266
263
/// ```
267
- ///
268
- /// [`BuildHasher`]: ../../std/hash/trait.BuildHasher.html
269
264
#[ inline]
270
265
#[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
271
266
pub fn with_hasher ( hash_builder : S ) -> HashMap < K , V , S > {
@@ -296,8 +291,6 @@ impl<K, V, S> HashMap<K, V, S> {
296
291
/// let mut map = HashMap::with_capacity_and_hasher(10, s);
297
292
/// map.insert(1, 2);
298
293
/// ```
299
- ///
300
- /// [`BuildHasher`]: ../../std/hash/trait.BuildHasher.html
301
294
#[ inline]
302
295
#[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
303
296
pub fn with_capacity_and_hasher ( capacity : usize , hash_builder : S ) -> HashMap < K , V , S > {
@@ -524,8 +517,6 @@ impl<K, V, S> HashMap<K, V, S> {
524
517
525
518
/// Returns a reference to the map's [`BuildHasher`].
526
519
///
527
- /// [`BuildHasher`]: ../../std/hash/trait.BuildHasher.html
528
- ///
529
520
/// # Examples
530
521
///
531
522
/// ```
@@ -556,8 +547,6 @@ where
556
547
///
557
548
/// Panics if the new allocation size overflows [`usize`].
558
549
///
559
- /// [`usize`]: ../../std/primitive.usize.html
560
- ///
561
550
/// # Examples
562
551
///
563
552
/// ```
@@ -676,9 +665,6 @@ where
676
665
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
677
666
/// the key type.
678
667
///
679
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
680
- /// [`Hash`]: ../../std/hash/trait.Hash.html
681
- ///
682
668
/// # Examples
683
669
///
684
670
/// ```
@@ -705,9 +691,6 @@ where
705
691
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
706
692
/// the key type.
707
693
///
708
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
709
- /// [`Hash`]: ../../std/hash/trait.Hash.html
710
- ///
711
694
/// # Examples
712
695
///
713
696
/// ```
@@ -734,9 +717,6 @@ where
734
717
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
735
718
/// the key type.
736
719
///
737
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
738
- /// [`Hash`]: ../../std/hash/trait.Hash.html
739
- ///
740
720
/// # Examples
741
721
///
742
722
/// ```
@@ -763,9 +743,6 @@ where
763
743
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
764
744
/// the key type.
765
745
///
766
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
767
- /// [`Hash`]: ../../std/hash/trait.Hash.html
768
- ///
769
746
/// # Examples
770
747
///
771
748
/// ```
@@ -797,8 +774,7 @@ where
797
774
/// types that can be `==` without being identical. See the [module-level
798
775
/// documentation] for more.
799
776
///
800
- /// [`None`]: ../../std/option/enum.Option.html#variant.None
801
- /// [module-level documentation]: index.html#insert-and-complex-keys
777
+ /// [module-level documentation]: crate::collections#insert-and-complex-keys
802
778
///
803
779
/// # Examples
804
780
///
@@ -826,9 +802,6 @@ where
826
802
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
827
803
/// the key type.
828
804
///
829
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
830
- /// [`Hash`]: ../../std/hash/trait.Hash.html
831
- ///
832
805
/// # Examples
833
806
///
834
807
/// ```
@@ -856,9 +829,6 @@ where
856
829
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
857
830
/// the key type.
858
831
///
859
- /// [`Eq`]: ../../std/cmp/trait.Eq.html
860
- /// [`Hash`]: ../../std/hash/trait.Hash.html
861
- ///
862
832
/// # Examples
863
833
///
864
834
/// ```
@@ -1040,8 +1010,7 @@ where
1040
1010
/// This `struct` is created by the [`iter`] method on [`HashMap`]. See its
1041
1011
/// documentation for more.
1042
1012
///
1043
- /// [`iter`]: struct.HashMap.html#method.iter
1044
- /// [`HashMap`]: struct.HashMap.html
1013
+ /// [`iter`]: HashMap::iter
1045
1014
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1046
1015
pub struct Iter < ' a , K : ' a , V : ' a > {
1047
1016
base : base:: Iter < ' a , K , V > ,
@@ -1068,8 +1037,7 @@ impl<K: Debug, V: Debug> fmt::Debug for Iter<'_, K, V> {
1068
1037
/// This `struct` is created by the [`iter_mut`] method on [`HashMap`]. See its
1069
1038
/// documentation for more.
1070
1039
///
1071
- /// [`iter_mut`]: struct.HashMap.html#method.iter_mut
1072
- /// [`HashMap`]: struct.HashMap.html
1040
+ /// [`iter_mut`]: HashMap::iter_mut
1073
1041
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1074
1042
pub struct IterMut < ' a , K : ' a , V : ' a > {
1075
1043
base : base:: IterMut < ' a , K , V > ,
@@ -1088,8 +1056,7 @@ impl<'a, K, V> IterMut<'a, K, V> {
1088
1056
/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
1089
1057
/// (provided by the `IntoIterator` trait). See its documentation for more.
1090
1058
///
1091
- /// [`into_iter`]: struct.HashMap.html#method.into_iter
1092
- /// [`HashMap`]: struct.HashMap.html
1059
+ /// [`into_iter`]: IntoIterator::into_iter
1093
1060
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1094
1061
pub struct IntoIter < K , V > {
1095
1062
base : base:: IntoIter < K , V > ,
@@ -1108,8 +1075,7 @@ impl<K, V> IntoIter<K, V> {
1108
1075
/// This `struct` is created by the [`keys`] method on [`HashMap`]. See its
1109
1076
/// documentation for more.
1110
1077
///
1111
- /// [`keys`]: struct.HashMap.html#method.keys
1112
- /// [`HashMap`]: struct.HashMap.html
1078
+ /// [`keys`]: HashMap::keys
1113
1079
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1114
1080
pub struct Keys < ' a , K : ' a , V : ' a > {
1115
1081
inner : Iter < ' a , K , V > ,
@@ -1136,8 +1102,7 @@ impl<K: Debug, V> fmt::Debug for Keys<'_, K, V> {
1136
1102
/// This `struct` is created by the [`values`] method on [`HashMap`]. See its
1137
1103
/// documentation for more.
1138
1104
///
1139
- /// [`values`]: struct.HashMap.html#method.values
1140
- /// [`HashMap`]: struct.HashMap.html
1105
+ /// [`values`]: HashMap::values
1141
1106
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1142
1107
pub struct Values < ' a , K : ' a , V : ' a > {
1143
1108
inner : Iter < ' a , K , V > ,
@@ -1164,8 +1129,7 @@ impl<K, V: Debug> fmt::Debug for Values<'_, K, V> {
1164
1129
/// This `struct` is created by the [`drain`] method on [`HashMap`]. See its
1165
1130
/// documentation for more.
1166
1131
///
1167
- /// [`drain`]: struct.HashMap.html#method.drain
1168
- /// [`HashMap`]: struct.HashMap.html
1132
+ /// [`drain`]: HashMap::drain
1169
1133
#[ stable( feature = "drain" , since = "1.6.0" ) ]
1170
1134
pub struct Drain < ' a , K : ' a , V : ' a > {
1171
1135
base : base:: Drain < ' a , K , V > ,
@@ -1184,8 +1148,7 @@ impl<'a, K, V> Drain<'a, K, V> {
1184
1148
/// This `struct` is created by the [`values_mut`] method on [`HashMap`]. See its
1185
1149
/// documentation for more.
1186
1150
///
1187
- /// [`values_mut`]: struct.HashMap.html#method.values_mut
1188
- /// [`HashMap`]: struct.HashMap.html
1151
+ /// [`values_mut`]: HashMap::values_mut
1189
1152
#[ stable( feature = "map_values_mut" , since = "1.10.0" ) ]
1190
1153
pub struct ValuesMut < ' a , K : ' a , V : ' a > {
1191
1154
inner : IterMut < ' a , K , V > ,
@@ -1195,7 +1158,7 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
1195
1158
///
1196
1159
/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
1197
1160
///
1198
- /// [`HashMap::raw_entry_mut`]: struct. HashMap.html#method. raw_entry_mut
1161
+ /// [`HashMap::raw_entry_mut`]: HashMap:: raw_entry_mut
1199
1162
1200
1163
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1201
1164
pub struct RawEntryBuilderMut < ' a , K : ' a , V : ' a , S : ' a > {
@@ -1209,9 +1172,8 @@ pub struct RawEntryBuilderMut<'a, K: 'a, V: 'a, S: 'a> {
1209
1172
/// This `enum` is constructed through the [`raw_entry_mut`] method on [`HashMap`],
1210
1173
/// then calling one of the methods of that [`RawEntryBuilderMut`].
1211
1174
///
1212
- /// [`HashMap`]: struct.HashMap.html
1213
1175
/// [`Entry`]: enum.Entry.html
1214
- /// [`raw_entry_mut`]: struct. HashMap.html#method. raw_entry_mut
1176
+ /// [`raw_entry_mut`]: HashMap:: raw_entry_mut
1215
1177
/// [`RawEntryBuilderMut`]: struct.RawEntryBuilderMut.html
1216
1178
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1217
1179
pub enum RawEntryMut < ' a , K : ' a , V : ' a , S : ' a > {
@@ -1223,17 +1185,13 @@ pub enum RawEntryMut<'a, K: 'a, V: 'a, S: 'a> {
1223
1185
1224
1186
/// A view into an occupied entry in a `HashMap`.
1225
1187
/// It is part of the [`RawEntryMut`] enum.
1226
- ///
1227
- /// [`RawEntryMut`]: enum.RawEntryMut.html
1228
1188
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1229
1189
pub struct RawOccupiedEntryMut < ' a , K : ' a , V : ' a > {
1230
1190
base : base:: RawOccupiedEntryMut < ' a , K , V > ,
1231
1191
}
1232
1192
1233
1193
/// A view into a vacant entry in a `HashMap`.
1234
1194
/// It is part of the [`RawEntryMut`] enum.
1235
- ///
1236
- /// [`RawEntryMut`]: enum.RawEntryMut.html
1237
1195
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1238
1196
pub struct RawVacantEntryMut < ' a , K : ' a , V : ' a , S : ' a > {
1239
1197
base : base:: RawVacantEntryMut < ' a , K , V , S > ,
@@ -1243,7 +1201,7 @@ pub struct RawVacantEntryMut<'a, K: 'a, V: 'a, S: 'a> {
1243
1201
///
1244
1202
/// See the [`HashMap::raw_entry`] docs for usage examples.
1245
1203
///
1246
- /// [`HashMap::raw_entry`]: struct. HashMap.html#method. raw_entry
1204
+ /// [`HashMap::raw_entry`]: HashMap:: raw_entry
1247
1205
#[ unstable( feature = "hash_raw_entry" , issue = "56167" ) ]
1248
1206
pub struct RawEntryBuilder < ' a , K : ' a , V : ' a , S : ' a > {
1249
1207
map : & ' a HashMap < K , V , S > ,
@@ -1597,8 +1555,7 @@ impl<K, V, S> Debug for RawEntryBuilder<'_, K, V, S> {
1597
1555
///
1598
1556
/// This `enum` is constructed from the [`entry`] method on [`HashMap`].
1599
1557
///
1600
- /// [`HashMap`]: struct.HashMap.html
1601
- /// [`entry`]: struct.HashMap.html#method.entry
1558
+ /// [`entry`]: HashMap::entry
1602
1559
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1603
1560
pub enum Entry < ' a , K : ' a , V : ' a > {
1604
1561
/// An occupied entry.
@@ -2156,7 +2113,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
2156
2113
/// If you need a reference to the `OccupiedEntry` which may outlive the
2157
2114
/// destruction of the `Entry` value, see [`into_mut`].
2158
2115
///
2159
- /// [`into_mut`]: #method. into_mut
2116
+ /// [`into_mut`]: Self:: into_mut
2160
2117
///
2161
2118
/// # Examples
2162
2119
///
@@ -2189,7 +2146,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
2189
2146
///
2190
2147
/// If you need multiple references to the `OccupiedEntry`, see [`get_mut`].
2191
2148
///
2192
- /// [`get_mut`]: #method. get_mut
2149
+ /// [`get_mut`]: Self:: get_mut
2193
2150
///
2194
2151
/// # Examples
2195
2152
///
@@ -2475,9 +2432,6 @@ where
2475
2432
/// [`Hasher`], but the hashers created by two different `RandomState`
2476
2433
/// instances are unlikely to produce the same result for the same values.
2477
2434
///
2478
- /// [`HashMap`]: struct.HashMap.html
2479
- /// [`Hasher`]: ../../hash/trait.Hasher.html
2480
- ///
2481
2435
/// # Examples
2482
2436
///
2483
2437
/// ```
@@ -2547,9 +2501,6 @@ impl BuildHasher for RandomState {
2547
2501
///
2548
2502
/// The internal algorithm is not specified, and so it and its hashes should
2549
2503
/// not be relied upon over releases.
2550
- ///
2551
- /// [`RandomState`]: struct.RandomState.html
2552
- /// [`Hasher`]: ../../hash/trait.Hasher.html
2553
2504
#[ stable( feature = "hashmap_default_hasher" , since = "1.13.0" ) ]
2554
2505
#[ allow( deprecated) ]
2555
2506
#[ derive( Clone , Debug ) ]
0 commit comments