diff --git a/src/external_trait_impls/rayon/map.rs b/src/external_trait_impls/rayon/map.rs index 9623ca747..1c993e042 100644 --- a/src/external_trait_impls/rayon/map.rs +++ b/src/external_trait_impls/rayon/map.rs @@ -15,9 +15,8 @@ use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, Pa /// (provided by the [`IntoParallelRefIterator`] trait). /// See its documentation for more. /// -/// [`par_iter`]: /hashbrown/struct.HashMap.html#method.par_iter -/// [`HashMap`]: /hashbrown/struct.HashMap.html -/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html +/// [`par_iter`]: rayon::iter::IntoParallelRefIterator::par_iter +/// [`IntoParallelRefIterator`]: rayon::iter::IntoParallelRefIterator pub struct ParIter<'a, K, V> { inner: RawParIter<(K, V)>, marker: PhantomData<(&'a K, &'a V)>, @@ -65,8 +64,7 @@ impl fmt::Debug for ParIter<'_, K, V> /// This iterator is created by the [`par_keys`] method on [`HashMap`]. /// See its documentation for more. /// -/// [`par_keys`]: /hashbrown/struct.HashMap.html#method.par_keys -/// [`HashMap`]: /hashbrown/struct.HashMap.html +/// [`par_keys`]: HashMap::par_keys pub struct ParKeys<'a, K, V> { inner: RawParIter<(K, V)>, marker: PhantomData<(&'a K, &'a V)>, @@ -108,8 +106,7 @@ impl fmt::Debug for ParKeys<'_, K, V> { /// This iterator is created by the [`par_values`] method on [`HashMap`]. /// See its documentation for more. /// -/// [`par_values`]: /hashbrown/struct.HashMap.html#method.par_values -/// [`HashMap`]: /hashbrown/struct.HashMap.html +/// [`par_values`]: HashMap::par_values pub struct ParValues<'a, K, V> { inner: RawParIter<(K, V)>, marker: PhantomData<(&'a K, &'a V)>, @@ -152,9 +149,8 @@ impl fmt::Debug for ParValues<'_, K, V> { /// (provided by the [`IntoParallelRefMutIterator`] trait). /// See its documentation for more. /// -/// [`par_iter_mut`]: /hashbrown/struct.HashMap.html#method.par_iter_mut -/// [`HashMap`]: /hashbrown/struct.HashMap.html -/// [`IntoParallelRefMutIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefMutIterator.html +/// [`par_iter_mut`]: rayon::iter::IntoParallelRefMutIterator::par_iter_mut +/// [`IntoParallelRefMutIterator`]: rayon::iter::IntoParallelRefMutIterator pub struct ParIterMut<'a, K, V> { inner: RawParIter<(K, V)>, marker: PhantomData<(&'a K, &'a mut V)>, @@ -192,8 +188,7 @@ impl fmt::Debug for ParIterMut<'_, K, /// This iterator is created by the [`par_values_mut`] method on [`HashMap`]. /// See its documentation for more. /// -/// [`par_values_mut`]: /hashbrown/struct.HashMap.html#method.par_values_mut -/// [`HashMap`]: /hashbrown/struct.HashMap.html +/// [`par_values_mut`]: HashMap::par_values_mut pub struct ParValuesMut<'a, K, V> { inner: RawParIter<(K, V)>, marker: PhantomData<(&'a K, &'a mut V)>, @@ -229,9 +224,7 @@ impl fmt::Debug for ParValuesMut<'_, K, V> { /// (provided by the [`IntoParallelIterator`] trait). /// See its documentation for more. /// -/// [`into_par_iter`]: /hashbrown/struct.HashMap.html#method.into_par_iter -/// [`HashMap`]: /hashbrown/struct.HashMap.html -/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html +/// [`into_par_iter`]: HashMap::into_par_iter pub struct IntoParIter { inner: RawIntoParIter<(K, V), A>, } @@ -263,8 +256,7 @@ impl fmt::Debug for Into /// This iterator is created by the [`par_drain`] method on [`HashMap`]. /// See its documentation for more. /// -/// [`par_drain`]: /hashbrown/struct.HashMap.html#method.par_drain -/// [`HashMap`]: /hashbrown/struct.HashMap.html +/// [`par_drain`]: HashMap::par_drain pub struct ParDrain<'a, K, V, A: Allocator = Global> { inner: RawParDrain<'a, (K, V), A>, } diff --git a/src/external_trait_impls/rayon/set.rs b/src/external_trait_impls/rayon/set.rs index 3de98fccb..bafac4576 100644 --- a/src/external_trait_impls/rayon/set.rs +++ b/src/external_trait_impls/rayon/set.rs @@ -13,9 +13,8 @@ use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, Pa /// (provided by the [`IntoParallelIterator`] trait). /// See its documentation for more. /// -/// [`into_par_iter`]: /hashbrown/struct.HashSet.html#method.into_par_iter -/// [`HashSet`]: /hashbrown/struct.HashSet.html -/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html +/// [`into_par_iter`]: rayon::iter::IntoParallelIterator::into_par_iter +/// [`IntoParallelIterator`]: rayon::iter::IntoParallelIterator pub struct IntoParIter { inner: map::IntoParIter, } @@ -36,8 +35,7 @@ impl ParallelIterator for IntoParIter { /// This iterator is created by the [`par_drain`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`par_drain`]: /hashbrown/struct.HashSet.html#method.par_drain -/// [`HashSet`]: /hashbrown/struct.HashSet.html +/// [`par_drain`]: HashSet::par_drain pub struct ParDrain<'a, T, A: Allocator = Global> { inner: map::ParDrain<'a, T, (), A>, } @@ -59,9 +57,8 @@ impl ParallelIterator for ParDrain<'_, T, A /// (provided by the [`IntoParallelRefIterator`] trait). /// See its documentation for more. /// -/// [`par_iter`]: /hashbrown/struct.HashSet.html#method.par_iter -/// [`HashSet`]: /hashbrown/struct.HashSet.html -/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html +/// [`par_iter`]: rayon::iter::IntoParallelRefIterator::par_iter +/// [`IntoParallelRefIterator`]: rayon::iter::IntoParallelRefIterator pub struct ParIter<'a, T> { inner: map::ParKeys<'a, T, ()>, } @@ -83,8 +80,7 @@ impl<'a, T: Sync> ParallelIterator for ParIter<'a, T> { /// This iterator is created by the [`par_difference`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`par_difference`]: /hashbrown/struct.HashSet.html#method.par_difference -/// [`HashSet`]: /hashbrown/struct.HashSet.html +/// [`par_difference`]: HashSet::par_difference pub struct ParDifference<'a, T, S, A: Allocator = Global> { a: &'a HashSet, b: &'a HashSet, @@ -116,8 +112,7 @@ where /// [`HashSet`]. /// See its documentation for more. /// -/// [`par_symmetric_difference`]: /hashbrown/struct.HashSet.html#method.par_symmetric_difference -/// [`HashSet`]: /hashbrown/struct.HashSet.html +/// [`par_symmetric_difference`]: HashSet::par_symmetric_difference pub struct ParSymmetricDifference<'a, T, S, A: Allocator = Global> { a: &'a HashSet, b: &'a HashSet, @@ -148,8 +143,7 @@ where /// This iterator is created by the [`par_intersection`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`par_intersection`]: /hashbrown/struct.HashSet.html#method.par_intersection -/// [`HashSet`]: /hashbrown/struct.HashSet.html +/// [`par_intersection`]: HashSet::par_intersection pub struct ParIntersection<'a, T, S, A: Allocator = Global> { a: &'a HashSet, b: &'a HashSet, @@ -179,8 +173,7 @@ where /// This iterator is created by the [`par_union`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`par_union`]: /hashbrown/struct.HashSet.html#method.par_union -/// [`HashSet`]: /hashbrown/struct.HashSet.html +/// [`par_union`]: HashSet::par_union pub struct ParUnion<'a, T, S, A: Allocator = Global> { a: &'a HashSet, b: &'a HashSet, diff --git a/src/external_trait_impls/rayon/table.rs b/src/external_trait_impls/rayon/table.rs index cb04a03df..6c943eccd 100644 --- a/src/external_trait_impls/rayon/table.rs +++ b/src/external_trait_impls/rayon/table.rs @@ -14,9 +14,8 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; /// (provided by the [`IntoParallelRefIterator`] trait). /// See its documentation for more. /// -/// [`par_iter`]: /hashbrown/struct.HashTable.html#method.par_iter -/// [`HashTable`]: /hashbrown/struct.HashTable.html -/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html +/// [`par_iter`]: rayon::iter::IntoParallelRefIterator::par_iter +/// [`IntoParallelRefIterator`]: rayon::iter::IntoParallelRefIterator pub struct ParIter<'a, T> { inner: RawParIter, marker: PhantomData<&'a T>, @@ -59,9 +58,8 @@ impl fmt::Debug for ParIter<'_, T> { /// (provided by the [`IntoParallelRefMutIterator`] trait). /// See its documentation for more. /// -/// [`par_iter_mut`]: /hashbrown/struct.HashTable.html#method.par_iter_mut -/// [`HashTable`]: /hashbrown/struct.HashTable.html -/// [`IntoParallelRefMutIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefMutIterator.html +/// [`par_iter_mut`]: rayon::iter::IntoParallelRefMutIterator::par_iter_mut +/// [`IntoParallelRefMutIterator`]: rayon::iter::IntoParallelRefMutIterator pub struct ParIterMut<'a, T> { inner: RawParIter, marker: PhantomData<&'a mut T>, @@ -97,9 +95,8 @@ impl fmt::Debug for ParIterMut<'_, T> { /// (provided by the [`IntoParallelIterator`] trait). /// See its documentation for more. /// -/// [`into_par_iter`]: /hashbrown/struct.HashTable.html#method.into_par_iter -/// [`HashTable`]: /hashbrown/struct.HashTable.html -/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html +/// [`into_par_iter`]: rayon::iter::IntoParallelIterator::into_par_iter +/// [`IntoParallelIterator`]: rayon::iter::IntoParallelIterator pub struct IntoParIter { inner: RawIntoParIter, } @@ -131,8 +128,7 @@ impl fmt::Debug for IntoParIter { /// This iterator is created by the [`par_drain`] method on [`HashTable`]. /// See its documentation for more. /// -/// [`par_drain`]: /hashbrown/struct.HashTable.html#method.par_drain -/// [`HashTable`]: /hashbrown/struct.HashTable.html +/// [`par_drain`]: HashTable::par_drain pub struct ParDrain<'a, T, A: Allocator = Global> { inner: RawParDrain<'a, T, A>, } diff --git a/src/lib.rs b/src/lib.rs index c5faec43a..f1feb2bab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ //! [here]: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h //! [CppCon talk]: https://www.youtube.com/watch?v=ncHmEUmJZf4 -#![no_std] +#![cfg_attr(not(doc), no_std)] #![cfg_attr( feature = "nightly", feature( diff --git a/src/map.rs b/src/map.rs index 378bcb0bb..2f1b4895b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -133,14 +133,11 @@ pub use crate::raw_entry::*; /// The easiest way to use `HashMap` with a custom key type is to derive [`Eq`] and [`Hash`]. /// We must also derive [`PartialEq`]. /// -/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html -/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html -/// [`PartialEq`]: https://doc.rust-lang.org/std/cmp/trait.PartialEq.html -/// [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html -/// [`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html -/// [`default`]: #method.default -/// [`with_hasher`]: #method.with_hasher -/// [`with_capacity_and_hasher`]: #method.with_capacity_and_hasher +/// [`RefCell`]: std::cell::RefCell +/// [`Cell`]: std::cell::Cell +/// [`default`]: Default::default +/// [`with_hasher`]: HashMap::with_hasher +/// [`with_capacity_and_hasher`]: HashMap::with_capacity_and_hasher /// [`fnv`]: https://crates.io/crates/fnv /// [`foldhash`]: https://crates.io/crates/foldhash /// @@ -270,12 +267,11 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`], for example with /// [`with_hasher`](HashMap::with_hasher) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -300,12 +296,11 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`], for example with /// [`with_capacity_and_hasher`](HashMap::with_capacity_and_hasher) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -333,12 +328,11 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`], for example with /// [`with_hasher_in`](HashMap::with_hasher_in) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -377,12 +371,11 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`], for example with /// [`with_capacity_and_hasher_in`](HashMap::with_capacity_and_hasher_in) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -429,15 +422,13 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`]. /// /// The `hash_builder` passed should implement the [`BuildHasher`] trait for /// the `HashMap` to be useful, see its documentation for details. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html /// /// # Examples /// @@ -472,15 +463,13 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`]. /// /// The `hash_builder` passed should implement the [`BuildHasher`] trait for /// the `HashMap` to be useful, see its documentation for details. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html /// /// # Examples /// @@ -522,11 +511,10 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`]. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -558,11 +546,10 @@ impl HashMap { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashMap`]. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -584,8 +571,6 @@ impl HashMap { /// Returns a reference to the map's [`BuildHasher`]. /// - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html - /// /// # Examples /// /// ``` @@ -1083,8 +1068,7 @@ where /// in case of allocation error. Use [`try_reserve`](HashMap::try_reserve) instead /// if you want to handle memory allocation failure. /// - /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html - /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html + /// [`abort`]: alloc::alloc::handle_alloc_error /// /// # Examples /// @@ -1287,9 +1271,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -1323,9 +1304,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -1359,9 +1337,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -1399,9 +1374,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -1431,9 +1403,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -1820,8 +1789,6 @@ where /// types that can be `==` without being identical. See the [`std::collections`] /// [module-level documentation] for more. /// - /// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None - /// [`std::collections`]: https://doc.rust-lang.org/std/collections/index.html /// [module-level documentation]: https://doc.rust-lang.org/std/collections/index.html#insert-and-complex-keys /// /// # Examples @@ -1981,9 +1948,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -2020,9 +1984,6 @@ where /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for /// the key type. /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html - /// /// # Examples /// /// ``` @@ -2108,7 +2069,7 @@ where /// /// ``` /// use hashbrown::HashMap; - /// use std::collections::hash_map::RandomState; + /// use std::hash::RandomState; /// /// // You can specify all types of HashMap, including hasher and allocator. /// // Created map is empty and don't allocate memory @@ -2181,8 +2142,7 @@ where /// This `struct` is created by the [`iter`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`iter`]: struct.HashMap.html#method.iter -/// [`HashMap`]: struct.HashMap.html +/// [`iter`]: HashMap::iter /// /// # Examples /// @@ -2231,8 +2191,7 @@ impl fmt::Debug for Iter<'_, K, V> { /// This `struct` is created by the [`iter_mut`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`iter_mut`]: struct.HashMap.html#method.iter_mut -/// [`HashMap`]: struct.HashMap.html +/// [`iter_mut`]: HashMap::iter_mut /// /// # Examples /// @@ -2281,9 +2240,7 @@ impl IterMut<'_, K, V> { /// (provided by the [`IntoIterator`] trait). See its documentation for more. /// The map cannot be used after calling that method. /// -/// [`into_iter`]: struct.HashMap.html#method.into_iter -/// [`HashMap`]: struct.HashMap.html -/// [`IntoIterator`]: https://doc.rust-lang.org/core/iter/trait.IntoIterator.html +/// [`into_iter`]: HashMap::into_iter /// /// # Examples /// @@ -2326,8 +2283,7 @@ impl IntoIter { /// See its documentation for more. /// The map cannot be used after calling that method. /// -/// [`into_keys`]: struct.HashMap.html#method.into_keys -/// [`HashMap`]: struct.HashMap.html +/// [`into_keys`]: HashMap::into_keys /// /// # Examples /// @@ -2404,8 +2360,7 @@ impl fmt::Debug for IntoKeys { /// This `struct` is created by the [`into_values`] method on [`HashMap`]. /// See its documentation for more. The map cannot be used after calling that method. /// -/// [`into_values`]: struct.HashMap.html#method.into_values -/// [`HashMap`]: struct.HashMap.html +/// [`into_values`]: HashMap::into_values /// /// # Examples /// @@ -2482,8 +2437,7 @@ impl fmt::Debug for IntoValues { /// This `struct` is created by the [`keys`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`keys`]: struct.HashMap.html#method.keys -/// [`HashMap`]: struct.HashMap.html +/// [`keys`]: HashMap::keys /// /// # Examples /// @@ -2530,8 +2484,7 @@ impl fmt::Debug for Keys<'_, K, V> { /// This `struct` is created by the [`values`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`values`]: struct.HashMap.html#method.values -/// [`HashMap`]: struct.HashMap.html +/// [`values`]: HashMap::values /// /// # Examples /// @@ -2578,8 +2531,7 @@ impl fmt::Debug for Values<'_, K, V> { /// This `struct` is created by the [`drain`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`drain`]: struct.HashMap.html#method.drain -/// [`HashMap`]: struct.HashMap.html +/// [`drain`]: HashMap::drain /// /// # Examples /// @@ -2621,8 +2573,7 @@ impl Drain<'_, K, V, A> { /// This `struct` is created by the [`extract_if`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`extract_if`]: struct.HashMap.html#method.extract_if -/// [`HashMap`]: struct.HashMap.html +/// [`extract_if`]: HashMap::extract_if /// /// # Examples /// @@ -2678,8 +2629,7 @@ impl FusedIterator for ExtractIf<'_, K, V, F> where F: FnMut(&K, &mut V /// This `struct` is created by the [`values_mut`] method on [`HashMap`]. See its /// documentation for more. /// -/// [`values_mut`]: struct.HashMap.html#method.values_mut -/// [`HashMap`]: struct.HashMap.html +/// [`values_mut`]: HashMap::values_mut /// /// # Examples /// @@ -2707,8 +2657,7 @@ pub struct ValuesMut<'a, K, V> { /// /// This `enum` is constructed from the [`entry`] method on [`HashMap`]. /// -/// [`HashMap`]: struct.HashMap.html -/// [`entry`]: struct.HashMap.html#method.entry +/// [`entry`]: HashMap::entry /// /// # Examples /// @@ -2863,8 +2812,6 @@ impl Debug for OccupiedEntry<'_, K, V, S, A /// A view into a vacant entry in a `HashMap`. /// It is part of the [`Entry`] enum. /// -/// [`Entry`]: enum.Entry.html -/// /// # Examples /// /// ``` @@ -2910,13 +2857,9 @@ impl Debug for VacantEntry<'_, K, V, S, A> { /// /// [`Hash`] and [`Eq`] on the borrowed form of the map's key type *must* match those /// for the key type. It also require that key may be constructed from the borrowed -/// form through the [`From`] trait. +/// form through the [`ToOwned`] trait. /// -/// [`HashMap`]: struct.HashMap.html -/// [`entry_ref`]: struct.HashMap.html#method.entry_ref -/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html -/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html -/// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html +/// [`entry_ref`]: HashMap::entry_ref /// /// # Examples /// @@ -3007,8 +2950,6 @@ where /// A view into a vacant entry in a `HashMap`. /// It is part of the [`EntryRef`] enum. /// -/// [`EntryRef`]: enum.EntryRef.html -/// /// # Examples /// /// ``` @@ -3113,8 +3054,7 @@ impl<'a, K, V, S, A: Allocator> IntoIterator for &'a HashMap { /// /// Return the same `Iter` struct as by the [`iter`] method on [`HashMap`]. /// - /// [`iter`]: struct.HashMap.html#method.iter - /// [`HashMap`]: struct.HashMap.html + /// [`iter`]: HashMap::iter /// /// # Examples /// @@ -3147,8 +3087,7 @@ impl<'a, K, V, S, A: Allocator> IntoIterator for &'a mut HashMap { /// Return the same `IterMut` struct as by the [`iter_mut`] method on /// [`HashMap`]. /// - /// [`iter_mut`]: struct.HashMap.html#method.iter_mut - /// [`HashMap`]: struct.HashMap.html + /// [`iter_mut`]: HashMap::iter_mut /// /// # Examples /// @@ -4698,8 +4637,6 @@ where /// Replace values with existing keys with new values returned from the iterator. /// The keys and values must implement [`Copy`] trait. /// - /// [`Copy`]: https://doc.rust-lang.org/core/marker/trait.Copy.html - /// /// # Examples /// /// ``` @@ -4763,8 +4700,6 @@ where /// Replace values with existing keys with new values returned from the iterator. /// The keys and values must implement [`Copy`] trait. /// - /// [`Copy`]: https://doc.rust-lang.org/core/marker/trait.Copy.html - /// /// # Examples /// /// ``` diff --git a/src/raw/mod.rs b/src/raw/mod.rs index 235b6141e..2dd64b6ec 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -300,14 +300,6 @@ impl Bucket { /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` /// must be no greater than the number returned by the function /// [`RawTable::num_buckets`] or [`RawTableInner::num_buckets`]. - /// - /// [`Bucket`]: crate::raw::Bucket - /// [`<*mut T>::sub`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.sub-1 - /// [`NonNull::new_unchecked`]: https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.new_unchecked - /// [`RawTable::data_end`]: crate::raw::RawTable::data_end - /// [`RawTableInner::data_end`]: RawTableInner::data_end - /// [`RawTable::num_buckets`]: crate::raw::RawTable::num_buckets - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets #[inline] unsafe fn from_base_index(base: NonNull, index: usize) -> Self { // If mem::size_of::() != 0 then return a pointer to an `element` in @@ -373,14 +365,6 @@ impl Bucket { /// (or [`RawTableInner`]). /// /// If `mem::size_of::() == 0`, this function is always safe. - /// - /// [`Bucket`]: crate::raw::Bucket - /// [`from_base_index`]: crate::raw::Bucket::from_base_index - /// [`RawTable::data_end`]: crate::raw::RawTable::data_end - /// [`RawTableInner::data_end`]: RawTableInner::data_end - /// [`RawTable`]: crate::raw::RawTable - /// [`RawTableInner`]: RawTableInner - /// [`<*const T>::offset_from`]: https://doc.rust-lang.org/nightly/core/primitive.pointer.html#method.offset_from #[inline] unsafe fn to_base_index(&self, base: NonNull) -> usize { // If mem::size_of::() != 0 then return an index under which we used to store the @@ -426,11 +410,6 @@ impl Bucket { /// `T` value and its borrowed form *must* match those for the old `T` value, as the map /// will not re-evaluate where the new value should go, meaning the value may become /// "lost" if their location does not reflect their state. - /// - /// [`RawTable`]: crate::raw::RawTable - /// [`<*mut T>::drop_in_place`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.drop_in_place - /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html - /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html #[inline] pub fn as_ptr(&self) -> *mut T { if T::IS_ZERO_SIZED { @@ -480,12 +459,6 @@ impl Bucket { /// i.e. `(self.to_base_index() + offset) <= RawTableInner.bucket_mask` or, in other words, /// `self.to_base_index() + offset + 1` must be no greater than the number returned by the /// function [`RawTable::num_buckets`] or [`RawTableInner::num_buckets`]. - /// - /// [`Bucket`]: crate::raw::Bucket - /// [`<*mut T>::sub`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.sub-1 - /// [`NonNull::new_unchecked`]: https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.new_unchecked - /// [`RawTable::num_buckets`]: crate::raw::RawTable::num_buckets - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets #[inline] unsafe fn next_n(&self, offset: usize) -> Self { let ptr = if T::IS_ZERO_SIZED { @@ -510,10 +483,6 @@ impl Bucket { /// properly dropping the data we need also clear `data` control bytes. /// If we drop data, but do not erase `data control byte` it leads to /// double drop when [`RawTable`] goes out of scope. - /// - /// [`ptr::drop_in_place`]: https://doc.rust-lang.org/core/ptr/fn.drop_in_place.html - /// [`RawTable`]: crate::raw::RawTable - /// [`RawTable::erase`]: crate::raw::RawTable::erase #[cfg_attr(feature = "inline-more", inline)] pub(crate) unsafe fn drop(&self) { self.as_ptr().drop_in_place(); @@ -531,10 +500,6 @@ impl Bucket { /// calls its destructor when the read `value` goes out of scope. It /// can cause double dropping when [`RawTable`] goes out of scope, /// because of not erased `data control byte`. - /// - /// [`ptr::read`]: https://doc.rust-lang.org/core/ptr/fn.read.html - /// [`RawTable`]: crate::raw::RawTable - /// [`RawTable::remove`]: crate::raw::RawTable::remove #[inline] pub(crate) unsafe fn read(&self) -> T { self.as_ptr().read() @@ -553,10 +518,6 @@ impl Bucket { /// those for the old `T` value, as the map will not re-evaluate where the new /// value should go, meaning the value may become "lost" if their location /// does not reflect their state. - /// - /// [`ptr::write`]: https://doc.rust-lang.org/core/ptr/fn.write.html - /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html - /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html #[inline] pub(crate) unsafe fn write(&self, val: T) { self.as_ptr().write(val); @@ -567,8 +528,6 @@ impl Bucket { /// # Safety /// /// See [`NonNull::as_ref`] for safety concerns. - /// - /// [`NonNull::as_ref`]: https://doc.rust-lang.org/core/ptr/struct.NonNull.html#method.as_ref #[inline] pub unsafe fn as_ref<'a>(&self) -> &'a T { &*self.as_ptr() @@ -586,10 +545,6 @@ impl Bucket { /// those for the old `T` value, as the map will not re-evaluate where the new /// value should go, meaning the value may become "lost" if their location /// does not reflect their state. - /// - /// [`NonNull::as_mut`]: https://doc.rust-lang.org/core/ptr/struct.NonNull.html#method.as_mut - /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html - /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html #[inline] pub unsafe fn as_mut<'a>(&self) -> &'a mut T { &mut *self.as_ptr() @@ -779,7 +734,6 @@ impl RawTable { /// not be greater than the number returned by the [`RawTable::num_buckets`] function, i.e. /// `(index + 1) <= self.num_buckets()`. /// - /// [`RawTable::num_buckets`]: RawTable::num_buckets /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] pub unsafe fn bucket(&self, index: usize) -> Bucket { @@ -1044,7 +998,6 @@ impl RawTable { /// /// See [`RawTableInner::find_insert_index`] for more information. /// - /// [`RawTableInner::find_insert_index`]: RawTableInner::find_insert_index /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html unsafe fn resize( &mut self, @@ -1591,7 +1544,7 @@ impl RawTableInner { /// /// See also [`Allocator`] API for other safety concerns. /// - /// [`Allocator`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html + /// [`Allocator`]: alloc::alloc::Allocator #[cfg_attr(feature = "inline-more", inline)] unsafe fn new_uninitialized( alloc: &A, @@ -1690,7 +1643,7 @@ impl RawTableInner { /// All the control bytes are initialized with the [`Tag::EMPTY`] bytes. /// /// [`fallible_with_capacity`]: RawTableInner::fallible_with_capacity - /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html + /// [`abort`]: alloc::abort::handle_alloc_error fn with_capacity(alloc: &A, table_layout: TableLayout, capacity: usize) -> Self where A: Allocator, @@ -1743,8 +1696,6 @@ impl RawTableInner { /// may result in [`undefined behavior`] even if the index satisfies the safety rules of the /// [`RawTableInner::ctrl`] function (`index < self.bucket_mask + 1 + Group::WIDTH`). /// - /// [`RawTableInner::ctrl`]: RawTableInner::ctrl - /// [`RawTableInner::find_insert_index_in_group`]: RawTableInner::find_insert_index_in_group /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn fix_insert_index(&self, mut index: usize) -> usize { @@ -1941,11 +1892,7 @@ impl RawTableInner { /// See also [`Bucket::as_ptr`] method, for more information about of properly removing /// or saving `element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`Bucket::as_ptr`]: Bucket::as_ptr /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html - /// [`RawTableInner::ctrl`]: RawTableInner::ctrl - /// [`RawTableInner::set_ctrl_hash`]: RawTableInner::set_ctrl_hash - /// [`RawTableInner::find_insert_index`]: RawTableInner::find_insert_index #[inline] unsafe fn prepare_insert_index(&mut self, hash: u64) -> (usize, Tag) { // SAFETY: Caller of this function ensures that the control bytes are properly initialized. @@ -2116,7 +2063,6 @@ impl RawTableInner { /// See also [`Bucket::as_ptr`] method, for more information about of properly removing /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`Bucket::as_ptr`]: Bucket::as_ptr /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[allow(clippy::mut_mut)] #[inline] @@ -2243,9 +2189,6 @@ impl RawTableInner { /// about of properly removing or saving `element` from / into the [`RawTable`] / /// [`RawTableInner`]. /// - /// [`Bucket::drop`]: Bucket::drop - /// [`Bucket::as_ptr`]: Bucket::as_ptr - /// [`clear_no_drop`]: RawTableInner::clear_no_drop /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html unsafe fn drop_elements(&mut self) { // Check that `self.items != 0`. Protects against the possibility @@ -2305,8 +2248,6 @@ impl RawTableInner { /// See also [`RawTableInner::drop_elements`] or [`RawTableInner::free_buckets`] /// for more information. /// - /// [`RawTableInner::drop_elements`]: RawTableInner::drop_elements - /// [`RawTableInner::free_buckets`]: RawTableInner::free_buckets /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html unsafe fn drop_inner_table(&mut self, alloc: &A, table_layout: TableLayout) { if !self.is_empty_singleton() { @@ -2375,8 +2316,6 @@ impl RawTableInner { /// of buckets is a power of two, and `self.bucket_mask = self.num_buckets() - 1`. /// ``` /// - /// [`Bucket::from_base_index`]: Bucket::from_base_index - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn bucket(&self, index: usize) -> Bucket { @@ -2429,7 +2368,6 @@ impl RawTableInner { /// of buckets is a power of two, and `self.bucket_mask = self.num_buckets() - 1`. /// ``` /// - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn bucket_ptr(&self, index: usize, size_of: usize) -> *mut u8 { @@ -2532,9 +2470,6 @@ impl RawTableInner { /// See also [`Bucket::as_ptr`] method, for more information about of properly removing /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`RawTableInner::set_ctrl`]: RawTableInner::set_ctrl - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets - /// [`Bucket::as_ptr`]: Bucket::as_ptr /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn set_ctrl_hash(&mut self, index: usize, hash: u64) { @@ -2566,9 +2501,6 @@ impl RawTableInner { /// See also [`Bucket::as_ptr`] method, for more information about of properly removing /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`RawTableInner::set_ctrl_hash`]: RawTableInner::set_ctrl_hash - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets - /// [`Bucket::as_ptr`]: Bucket::as_ptr /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn replace_ctrl_hash(&mut self, index: usize, hash: u64) -> Tag { @@ -2599,8 +2531,6 @@ impl RawTableInner { /// See also [`Bucket::as_ptr`] method, for more information about of properly removing /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets - /// [`Bucket::as_ptr`]: Bucket::as_ptr /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn set_ctrl(&mut self, index: usize, ctrl: Tag) { @@ -2656,7 +2586,6 @@ impl RawTableInner { /// See also [`Bucket::as_ptr()`] method, for more information about of properly removing /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`Bucket::as_ptr()`]: Bucket::as_ptr() /// [`Undefined Behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn ctrl(&self, index: usize) -> *mut Tag { @@ -2916,7 +2845,6 @@ impl RawTableInner { /// this function can never return. See [`RawTableInner::find_insert_index`] for /// more information. /// - /// [`RawTableInner::find_insert_index`]: RawTableInner::find_insert_index /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[allow(clippy::inline_always)] #[inline(always)] @@ -3124,8 +3052,8 @@ impl RawTableInner { /// See also [`GlobalAlloc::dealloc`] or [`Allocator::deallocate`] for more information. /// /// [`Undefined Behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html - /// [`GlobalAlloc::dealloc`]: https://doc.rust-lang.org/alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc - /// [`Allocator::deallocate`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html#tymethod.deallocate + /// [`GlobalAlloc::dealloc`]: alloc::alloc::GlobalAlloc::dealloc + /// [`Allocator::deallocate`]: alloc::alloc::Allocator::deallocate #[inline] unsafe fn free_buckets(&mut self, alloc: &A, table_layout: TableLayout) where @@ -3154,8 +3082,8 @@ impl RawTableInner { /// See also [`GlobalAlloc::dealloc`] or [`Allocator::deallocate`] for more information. /// /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html - /// [`GlobalAlloc::dealloc`]: https://doc.rust-lang.org/alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc - /// [`Allocator::deallocate`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html#tymethod.deallocate + /// [`GlobalAlloc::dealloc`]: alloc::GlobalAlloc::dealloc + /// [`Allocator::deallocate`]: alloc::Allocator::deallocate #[inline] unsafe fn allocation_info(&self, table_layout: TableLayout) -> (NonNull, Layout) { debug_assert!( @@ -3242,8 +3170,6 @@ impl RawTableInner { /// See also [`Bucket::as_ptr`] method, for more information about of properly removing /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. /// - /// [`RawTableInner::num_buckets`]: RawTableInner::num_buckets - /// [`Bucket::as_ptr`]: Bucket::as_ptr /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[inline] unsafe fn erase(&mut self, index: usize) { diff --git a/src/raw_entry.rs b/src/raw_entry.rs index 20623a83b..cec54ae38 100644 --- a/src/raw_entry.rs +++ b/src/raw_entry.rs @@ -162,7 +162,7 @@ impl HashMap { /// /// See the [`HashMap::raw_entry_mut`] docs for usage examples. /// -/// [`HashMap::raw_entry_mut`]: struct.HashMap.html#method.raw_entry_mut +/// [`HashMap::raw_entry_mut`]: HashMap::raw_entry_mut /// /// # Examples /// @@ -221,13 +221,12 @@ pub struct RawEntryBuilderMut<'a, K, V, S, A: Allocator = Global> { /// /// This is a lower-level version of [`Entry`]. /// +/// [`Entry`]: crate::hash_map::Entry +/// /// This `enum` is constructed through the [`raw_entry_mut`] method on [`HashMap`], /// then calling one of the methods of that [`RawEntryBuilderMut`]. /// -/// [`HashMap`]: struct.HashMap.html -/// [`Entry`]: enum.Entry.html -/// [`raw_entry_mut`]: struct.HashMap.html#method.raw_entry_mut -/// [`RawEntryBuilderMut`]: struct.RawEntryBuilderMut.html +/// [`raw_entry_mut`]: HashMap::raw_entry_mut /// /// # Examples /// @@ -335,8 +334,6 @@ pub enum RawEntryMut<'a, K, V, S, A: Allocator = Global> { /// A view into an occupied entry in a `HashMap`. /// It is part of the [`RawEntryMut`] enum. /// -/// [`RawEntryMut`]: enum.RawEntryMut.html -/// /// # Examples /// /// ``` @@ -418,8 +415,6 @@ where /// A view into a vacant entry in a `HashMap`. /// It is part of the [`RawEntryMut`] enum. /// -/// [`RawEntryMut`]: enum.RawEntryMut.html -/// /// # Examples /// /// ``` @@ -472,7 +467,7 @@ pub struct RawVacantEntryMut<'a, K, V, S, A: Allocator = Global> { /// /// See the [`HashMap::raw_entry`] docs for usage examples. /// -/// [`HashMap::raw_entry`]: struct.HashMap.html#method.raw_entry +/// [`HashMap::raw_entry`]: HashMap::raw_entry /// /// # Examples /// diff --git a/src/rustc_entry.rs b/src/rustc_entry.rs index 233fe7a2d..d657a7661 100644 --- a/src/rustc_entry.rs +++ b/src/rustc_entry.rs @@ -57,8 +57,7 @@ where /// /// This `enum` is constructed from the [`rustc_entry`] method on [`HashMap`]. /// -/// [`HashMap`]: struct.HashMap.html -/// [`rustc_entry`]: struct.HashMap.html#method.rustc_entry +/// [`rustc_entry`]: HashMap::rustc_entry pub enum RustcEntry<'a, K, V, A = Global> where A: Allocator, @@ -81,8 +80,6 @@ impl Debug for RustcEntry<'_, K, V, A> { /// A view into an occupied entry in a `HashMap`. /// It is part of the [`RustcEntry`] enum. -/// -/// [`RustcEntry`]: enum.RustcEntry.html pub struct RustcOccupiedEntry<'a, K, V, A = Global> where A: Allocator, @@ -117,8 +114,6 @@ impl Debug for RustcOccupiedEntry<'_, K, V, A> /// A view into a vacant entry in a `HashMap`. /// It is part of the [`RustcEntry`] enum. -/// -/// [`RustcEntry`]: enum.RustcEntry.html pub struct RustcVacantEntry<'a, K, V, A = Global> where A: Allocator, diff --git a/src/set.rs b/src/set.rs index a875d2f50..448ebed09 100644 --- a/src/set.rs +++ b/src/set.rs @@ -105,12 +105,8 @@ use crate::DefaultHashBuilder; /// // use the values stored in the set /// ``` /// -/// [`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html -/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html -/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html -/// [`HashMap`]: struct.HashMap.html -/// [`PartialEq`]: https://doc.rust-lang.org/std/cmp/trait.PartialEq.html -/// [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html +/// [`Cell`]: std::cell::Cell +/// [`RefCell`]: std::cell::RefCell pub struct HashSet { pub(crate) map: HashMap, } @@ -139,12 +135,11 @@ impl HashSet { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`], for example with /// [`with_hasher`](HashSet::with_hasher) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -169,12 +164,11 @@ impl HashSet { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`], for example with /// [`with_capacity_and_hasher`](HashSet::with_capacity_and_hasher) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -203,12 +197,11 @@ impl HashSet { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`], for example with /// [`with_hasher_in`](HashSet::with_hasher_in) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -233,12 +226,11 @@ impl HashSet { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`], for example with /// [`with_capacity_and_hasher_in`](HashSet::with_capacity_and_hasher_in) method. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html /// /// # Examples /// @@ -444,15 +436,13 @@ impl HashSet { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`]. /// /// The `hash_builder` passed should implement the [`BuildHasher`] trait for /// the `HashSet` to be useful, see its documentation for details. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html /// /// # Examples /// @@ -483,15 +473,13 @@ impl HashSet { /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`]. /// /// The `hash_builder` passed should implement the [`BuildHasher`] trait for /// the `HashSet` to be useful, see its documentation for details. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html /// /// # Examples /// @@ -532,15 +520,13 @@ where /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`]. /// /// The `hash_builder` passed should implement the [`BuildHasher`] trait for /// the `HashSet` to be useful, see its documentation for details. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html /// /// # Examples /// @@ -571,15 +557,13 @@ where /// The `hash_builder` normally use a fixed key by default and that does /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. /// Users who require HashDoS resistance should explicitly use - /// [`std::collections::hash_map::RandomState`] + /// [`std::hash::RandomState`] /// as the hasher when creating a [`HashSet`]. /// /// The `hash_builder` passed should implement the [`BuildHasher`] trait for /// the `HashSet` to be useful, see its documentation for details. /// /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack - /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html /// /// # Examples /// @@ -600,8 +584,6 @@ where /// Returns a reference to the set's [`BuildHasher`]. /// - /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html - /// /// # Examples /// /// ``` @@ -634,8 +616,7 @@ where /// in case of allocation error. Use [`try_reserve`](HashSet::try_reserve) instead /// if you want to handle memory allocation failure. /// - /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html - /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html + /// [`abort`]: alloc::alloc::handle_alloc_error /// /// # Examples /// @@ -856,8 +837,6 @@ where /// assert_eq!(set.contains(&4), false); /// ``` /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html #[cfg_attr(feature = "inline-more", inline)] pub fn contains(&self, value: &Q) -> bool where @@ -882,8 +861,6 @@ where /// assert_eq!(set.get(&4), None); /// ``` /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html #[cfg_attr(feature = "inline-more", inline)] pub fn get(&self, value: &Q) -> Option<&T> where @@ -1169,8 +1146,6 @@ where /// assert_eq!(set.remove(&2), false); /// ``` /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html #[cfg_attr(feature = "inline-more", inline)] pub fn remove(&mut self, value: &Q) -> bool where @@ -1195,8 +1170,6 @@ where /// assert_eq!(set.take(&2), None); /// ``` /// - /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html - /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html #[cfg_attr(feature = "inline-more", inline)] pub fn take(&mut self, value: &Q) -> Option where @@ -1642,8 +1615,7 @@ where /// This `struct` is created by the [`iter`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`iter`]: struct.HashSet.html#method.iter +/// [`iter`]: HashSet::iter pub struct Iter<'a, K> { iter: Keys<'a, K, ()>, } @@ -1653,8 +1625,7 @@ pub struct Iter<'a, K> { /// This `struct` is created by the [`into_iter`] method on [`HashSet`] /// (provided by the `IntoIterator` trait). See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`into_iter`]: struct.HashSet.html#method.into_iter +/// [`into_iter`]: HashSet::into_iter pub struct IntoIter { iter: map::IntoIter, } @@ -1664,8 +1635,7 @@ pub struct IntoIter { /// This `struct` is created by the [`drain`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`drain`]: struct.HashSet.html#method.drain +/// [`drain`]: HashSet::drain pub struct Drain<'a, K, A: Allocator = Global> { iter: map::Drain<'a, K, (), A>, } @@ -1675,8 +1645,7 @@ pub struct Drain<'a, K, A: Allocator = Global> { /// This `struct` is created by the [`extract_if`] method on [`HashSet`]. See its /// documentation for more. /// -/// [`extract_if`]: struct.HashSet.html#method.extract_if -/// [`HashSet`]: struct.HashSet.html +/// [`extract_if`]: HashSet::extract_if #[must_use = "Iterators are lazy unless consumed"] pub struct ExtractIf<'a, K, F, A: Allocator = Global> { f: F, @@ -1688,8 +1657,7 @@ pub struct ExtractIf<'a, K, F, A: Allocator = Global> { /// This `struct` is created by the [`intersection`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`intersection`]: struct.HashSet.html#method.intersection +/// [`intersection`]: HashSet::intersection pub struct Intersection<'a, T, S, A: Allocator = Global> { // iterator of the first set iter: Iter<'a, T>, @@ -1702,8 +1670,7 @@ pub struct Intersection<'a, T, S, A: Allocator = Global> { /// This `struct` is created by the [`difference`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`difference`]: struct.HashSet.html#method.difference +/// [`difference`]: HashSet::difference pub struct Difference<'a, T, S, A: Allocator = Global> { // iterator of the first set iter: Iter<'a, T>, @@ -1716,8 +1683,7 @@ pub struct Difference<'a, T, S, A: Allocator = Global> { /// This `struct` is created by the [`symmetric_difference`] method on /// [`HashSet`]. See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`symmetric_difference`]: struct.HashSet.html#method.symmetric_difference +/// [`symmetric_difference`]: HashSet::symmetric_difference pub struct SymmetricDifference<'a, T, S, A: Allocator = Global> { iter: Chain, Difference<'a, T, S, A>>, } @@ -1727,8 +1693,7 @@ pub struct SymmetricDifference<'a, T, S, A: Allocator = Global> { /// This `struct` is created by the [`union`] method on [`HashSet`]. /// See its documentation for more. /// -/// [`HashSet`]: struct.HashSet.html -/// [`union`]: struct.HashSet.html#method.union +/// [`union`]: HashSet::union pub struct Union<'a, T, S, A: Allocator = Global> { iter: Chain, Difference<'a, T, S, A>>, } @@ -2186,8 +2151,7 @@ where /// /// This `enum` is constructed from the [`entry`] method on [`HashSet`]. /// -/// [`HashSet`]: struct.HashSet.html -/// [`entry`]: struct.HashSet.html#method.entry +/// [`entry`]: HashSet::entry /// /// # Examples /// @@ -2265,8 +2229,6 @@ impl fmt::Debug for Entry<'_, T, S, A> { /// A view into an occupied entry in a `HashSet`. /// It is part of the [`Entry`] enum. /// -/// [`Entry`]: enum.Entry.html -/// /// # Examples /// /// ``` @@ -2313,8 +2275,6 @@ impl fmt::Debug for OccupiedEntry<'_, T, S, A> { /// A view into a vacant entry in a `HashSet`. /// It is part of the [`Entry`] enum. /// -/// [`Entry`]: enum.Entry.html -/// /// # Examples /// /// ``` diff --git a/src/table.rs b/src/table.rs index f81b37d9a..a4aad7d36 100644 --- a/src/table.rs +++ b/src/table.rs @@ -43,8 +43,7 @@ use crate::{ /// /// [`HashMap`]: super::HashMap /// [`HashSet`]: super::HashSet -/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html -/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html +/// [`Hash`]: core::hash::Hash pub struct HashTable where A: Allocator, @@ -817,8 +816,7 @@ where /// in case of allocation error. Use [`try_reserve`](HashTable::try_reserve) instead /// if you want to handle memory allocation failure. /// - /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html - /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html + /// [`abort`]: alloc::alloc::handle_alloc_error /// /// # Examples /// @@ -1628,8 +1626,7 @@ where /// /// This `enum` is constructed from the [`entry`] method on [`HashTable`]. /// -/// [`HashTable`]: struct.HashTable.html -/// [`entry`]: struct.HashTable.html#method.entry +/// [`entry`]: HashTable::entry /// /// # Examples /// @@ -1929,8 +1926,6 @@ where /// A view into an occupied entry in a `HashTable`. /// It is part of the [`Entry`] enum. /// -/// [`Entry`]: enum.Entry.html -/// /// # Examples /// /// ``` @@ -2324,8 +2319,6 @@ where /// A view into a vacant entry in a `HashTable`. /// It is part of the [`Entry`] enum. /// -/// [`Entry`]: enum.Entry.html -/// /// # Examples /// /// ``` @@ -2502,8 +2495,7 @@ where /// This `struct` is created by the [`iter`] method on [`HashTable`]. See its /// documentation for more. /// -/// [`iter`]: struct.HashTable.html#method.iter -/// [`HashTable`]: struct.HashTable.html +/// [`iter`]: HashTable::iter pub struct Iter<'a, T> { inner: RawIter, marker: PhantomData<&'a T>, @@ -2575,8 +2567,7 @@ impl fmt::Debug for Iter<'_, T> { /// This `struct` is created by the [`iter_mut`] method on [`HashTable`]. See its /// documentation for more. /// -/// [`iter_mut`]: struct.HashTable.html#method.iter_mut -/// [`HashTable`]: struct.HashTable.html +/// [`iter_mut`]: HashTable::iter_mut pub struct IterMut<'a, T> { inner: RawIter, marker: PhantomData<&'a mut T>, @@ -2706,8 +2697,7 @@ impl fmt::Debug for IterBuckets<'_, T> { /// This `struct` is created by the [`iter_hash`] method on [`HashTable`]. See its /// documentation for more. /// -/// [`iter_hash`]: struct.HashTable.html#method.iter_hash -/// [`HashTable`]: struct.HashTable.html +/// [`iter_hash`]: HashTable::iter_hash pub struct IterHash<'a, T> { inner: RawIterHash, marker: PhantomData<&'a T>, @@ -2772,8 +2762,7 @@ where /// This `struct` is created by the [`iter_hash_mut`] method on [`HashTable`]. See its /// documentation for more. /// -/// [`iter_hash_mut`]: struct.HashTable.html#method.iter_hash_mut -/// [`HashTable`]: struct.HashTable.html +/// [`iter_hash_mut`]: HashTable::iter_hash_mut pub struct IterHashMut<'a, T> { inner: RawIterHash, marker: PhantomData<&'a mut T>, @@ -2879,9 +2868,7 @@ impl fmt::Debug for IterHashBuckets<'_, T> { /// (provided by the [`IntoIterator`] trait). See its documentation for more. /// The table cannot be used after calling that method. /// -/// [`into_iter`]: struct.HashTable.html#method.into_iter -/// [`HashTable`]: struct.HashTable.html -/// [`IntoIterator`]: https://doc.rust-lang.org/core/iter/trait.IntoIterator.html +/// [`into_iter`]: HashTable::into_iter pub struct IntoIter where A: Allocator, @@ -2952,8 +2939,7 @@ where /// This `struct` is created by the [`drain`] method on [`HashTable`]. /// See its documentation for more. /// -/// [`HashTable`]: struct.HashTable.html -/// [`drain`]: struct.HashTable.html#method.drain +/// [`drain`]: HashTable::drain pub struct Drain<'a, T, A: Allocator = Global> { inner: RawDrain<'a, T, A>, }