| 1 | //! `DynamicUsage` impls for `HashMap` and `HashSet`. |
| 2 | //! |
| 3 | //! Rust's `HashMap` and `HashSet` are backed by the the `hashbrown` crate. |
| 4 | |
| 5 | use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc alloc/::Layoutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/Layout#; |
| 6 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/; |
| 7 | |
| 8 | #[cfg(feature = "std")] |
| 9 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::{HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#, HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#}; |
| 10 | |
| 11 | use craterust-analyzer cargo memuse 0.2.2 crate/::DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage#; |
| 12 | |
| 13 | // The widths are sourced from here: |
| 14 | // https://github.com/rust-lang/hashbrown/blob/dbd6dbe30a4076c0ea65ca5bd57036c27f3cc7c9/src/raw/mod.rs#L15-L36 |
| 15 | // https://github.com/rust-lang/hashbrown/blob/dbd6dbe30a4076c0ea65ca5bd57036c27f3cc7c9/src/raw/generic.rs#L5-L21 |
| 16 | // https://github.com/rust-lang/hashbrown/blob/dbd6dbe30a4076c0ea65ca5bd57036c27f3cc7c9/src/raw/sse2.rs#L14-L19 |
| 17 | |
| 18 | #[cfg(all(target_feature = "sse2", target_arch = "x86", not(miri)))] |
| 19 | pub(craterust-analyzer cargo memuse 0.2.2 crate/) const WIDTH: usize = memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::x86::__m128i>(); |
| 20 | #[cfg(all(target_feature = "sse2", target_arch = "x86_64", not(miri)))] |
| 21 | pub(craterust-analyzer cargo memuse 0.2.2 crate/) const WIDTH: usize = memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::x86_64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/::__m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#>(); |
| 22 | #[cfg(all( |
| 23 | any(not(target_feature = "sse2"), miri), |
| 24 | any( |
| 25 | target_pointer_width = "64", |
| 26 | target_arch = "aarch64", |
| 27 | target_arch = "x86_64", |
| 28 | target_arch = "wasm32", |
| 29 | ) |
| 30 | ))] |
| 31 | pub(craterust-analyzer cargo memuse 0.2.2 crate/) const WIDTHrust-analyzer cargo memuse 0.2.2 hash/WIDTH.: usize = memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u64>(); |
| 32 | #[cfg(all( |
| 33 | any(not(target_feature = "sse2"), miri), |
| 34 | target_pointer_width = "32", |
| 35 | not(target_arch = "aarch64"), |
| 36 | not(target_arch = "x86_64"), |
| 37 | not(target_arch = "wasm32"), |
| 38 | ))] |
| 39 | pub(craterust-analyzer cargo memuse 0.2.2 crate/) const WIDTH: usize = memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u32>(); |
| 40 | |
| 41 | fn dynamic_usage_for_capacityrust-analyzer cargo memuse 0.2.2 hash/dynamic_usage_for_capacity().<K, V>(cap: usize) -> usize { |
| 42 | // The bucket calculation is sourced from here: |
| 43 | // https://github.com/rust-lang/hashbrown/blob/dbd6dbe30a4076c0ea65ca5bd57036c27f3cc7c9/src/raw/mod.rs#L187-L216 |
| 44 | // |
| 45 | // hashbrown's RawTable::buckets is not accessible via the std HashMap, and |
| 46 | // HashMap::capacity is a lower bound. However, hashbrown has an invariant that |
| 47 | // the number of buckets is a power of two, so usually we'll calculate the correct |
| 48 | // memory usage, and occasionally we'll undercount by around a factor of two. |
| 49 | let buckets = { |
| 50 | if cap rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().8 { |
| 51 | return if cap rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().4 { 4 } else { 8 }; |
| 52 | } |
| 53 | let adjusted_cap = (cap rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().8) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().7; |
| 54 | adjusted_cap.next_power_of_tworust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]next_power_of_two().() |
| 55 | }; |
| 56 | |
| 57 | // The memory usage calculation is sourced from here: |
| 58 | // https://github.com/rust-lang/hashbrown/blob/dbd6dbe30a4076c0ea65ca5bd57036c27f3cc7c9/src/raw/mod.rs#L240-L265 |
| 59 | |
| 60 | let layout = Layoutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/Layout#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/impl#[Layout]new().::<(K, V)>(); |
| 61 | let size = layout.sizerust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/impl#[Layout]size().(); |
| 62 | let ctrl_align = usize::maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(layout.alignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core alloc/layout/impl#[Layout]align().(), WIDTHrust-analyzer cargo memuse 0.2.2 hash/WIDTH.); |
| 63 | |
| 64 | let ctrl_offset = (size rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().buckets rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().ctrl_align rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`BitAnd<Self>`]bitand().!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][Not]not().(ctrl_align rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1); |
| 65 | ctrl_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().buckets rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().WIDTHrust-analyzer cargo memuse 0.2.2 hash/WIDTH. |
| 66 | } |
| 67 | |
| 68 | impl<K: DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage#, V: DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage#> DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage# for HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<K, V> { |
| 69 | fn dynamic_usagerust-analyzer cargo memuse 0.2.2 hash/impl#[`HashMap<K, V>`][DynamicUsage]dynamic_usage().(&self) -> usize { |
| 70 | dynamic_usage_for_capacityrust-analyzer cargo memuse 0.2.2 hash/dynamic_usage_for_capacity().::<K, V>(self.capacityrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]capacity().()) |
| 71 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self |
| 72 | .iterrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]iter().() |
| 73 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| k.dynamic_usagerust-analyzer cargo memuse 0.2.2 DynamicUsage#dynamic_usage().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().v.dynamic_usagerust-analyzer cargo memuse 0.2.2 DynamicUsage#dynamic_usage().()) |
| 74 | .sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().::<usize>() |
| 75 | } |
| 76 | |
| 77 | fn dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 hash/impl#[`HashMap<K, V>`][DynamicUsage]dynamic_usage_bounds().(&self) -> (usize, Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize>) { |
| 78 | ( |
| 79 | dynamic_usage_for_capacityrust-analyzer cargo memuse 0.2.2 hash/dynamic_usage_for_capacity().::<K, V>(self.capacityrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]capacity().()) |
| 80 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self |
| 81 | .iterrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]iter().() |
| 82 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(k, v)| k.dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 DynamicUsage#dynamic_usage_bounds().().0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().v.dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 DynamicUsage#dynamic_usage_bounds().().0) |
| 83 | .sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().::<usize>(), |
| 84 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 85 | ) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | impl<T: DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage#> DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage# for HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<T> { |
| 90 | fn dynamic_usagerust-analyzer cargo memuse 0.2.2 hash/impl#[`HashSet<T>`][DynamicUsage]dynamic_usage().(&self) -> usize { |
| 91 | // HashSet<T> is just HashMap<T, ()> |
| 92 | dynamic_usage_for_capacityrust-analyzer cargo memuse 0.2.2 hash/dynamic_usage_for_capacity().::<T, ()>(self.capacityrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S, A>`]capacity().()) |
| 93 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.iterrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S, A>`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(DynamicUsagerust-analyzer cargo memuse 0.2.2 DynamicUsage#::dynamic_usagerust-analyzer cargo memuse 0.2.2 DynamicUsage#dynamic_usage().).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().::<usize>() |
| 94 | } |
| 95 | |
| 96 | fn dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 hash/impl#[`HashSet<T>`][DynamicUsage]dynamic_usage_bounds().(&self) -> (usize, Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize>) { |
| 97 | ( |
| 98 | dynamic_usage_for_capacityrust-analyzer cargo memuse 0.2.2 hash/dynamic_usage_for_capacity().::<T, ()>(self.capacityrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S, A>`]capacity().()) |
| 99 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self |
| 100 | .iterrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S, A>`]iter().() |
| 101 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|k| k.dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 DynamicUsage#dynamic_usage_bounds().().0) |
| 102 | .sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().::<usize>(), |
| 103 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 104 | ) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | #[cfg(test)] |
| 109 | mod testsrust-analyzer cargo memuse 0.2.2 hash/tests/ { |
| 110 | use superrust-analyzer cargo memuse 0.2.2 hash/::*; |
| 111 | |
| 112 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 113 | fn hashmaprust-analyzer cargo memuse 0.2.2 hash/tests/hashmap().() { |
| 114 | let h: HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<u16, u32> = HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#::with_capacityrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V>`]with_capacity().(12); |
| 115 | |
| 116 | // - Capacity of 12 -> 16 buckets |
| 117 | // - Overhead is 1 byte per bucket |
| 118 | // - Fixed overhead of WIDTH |
| 119 | let lower = 16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().(memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<(u16, u32)>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().WIDTHrust-analyzer cargo memuse 0.2.2 hash/WIDTH.; |
| 120 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(h.dynamic_usagerust-analyzer cargo memuse 0.2.2 hash/impl#[`HashMap<K, V>`][DynamicUsage]dynamic_usage().(), lower); |
| 121 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(h.dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 hash/impl#[`HashMap<K, V>`][DynamicUsage]dynamic_usage_bounds().(), (lower, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)); |
| 122 | } |
| 123 | |
| 124 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 125 | fn hashsetrust-analyzer cargo memuse 0.2.2 hash/tests/hashset().() { |
| 126 | let h: HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<u16> = HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#::with_capacityrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T>`]with_capacity().(17); |
| 127 | |
| 128 | // - Capacity of 17 -> 32 buckets |
| 129 | // - Overhead is 1 byte per bucket |
| 130 | // - Fixed overhead of WIDTH |
| 131 | let lower = 32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().(memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<u16>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().WIDTHrust-analyzer cargo memuse 0.2.2 hash/WIDTH.; |
| 132 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(h.dynamic_usagerust-analyzer cargo memuse 0.2.2 hash/impl#[`HashSet<T>`][DynamicUsage]dynamic_usage().(), lower); |
| 133 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(h.dynamic_usage_boundsrust-analyzer cargo memuse 0.2.2 hash/impl#[`HashSet<T>`][DynamicUsage]dynamic_usage_bounds().(), (lower, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)); |
| 134 | } |
| 135 | } |