Skip to content

Commit 5cd3f34

Browse files
committed
Adding map-inner feature for getting access to map fields
1 parent 3b0a211 commit 5cd3f34

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ rustc-dep-of-std = [
5050
"rustc-internal-api",
5151
]
5252
raw = []
53+
map-inner = ["raw"]
5354

5455
# Enables usage of `#[inline]` on far more functions than by default in this
5556
# crate. This may lead to a performance increase but often comes at a compile

src/map.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,15 @@ pub enum DefaultHashBuilder {}
186186
/// // use the values stored in map
187187
/// ```
188188
pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator + Clone = Global> {
189+
#[cfg(any(feature = "rustc-internal-api", not(feature = "map-inner")))]
189190
pub(crate) hash_builder: S,
191+
#[cfg(any(feature = "rustc-internal-api", not(feature = "map-inner")))]
190192
pub(crate) table: RawTable<(K, V), A>,
193+
194+
#[cfg(all(feature = "map-inner", not(feature = "rustc-internal-api")))]
195+
pub hash_builder: S,
196+
#[cfg(all(feature = "map-inner", not(feature = "rustc-internal-api")))]
197+
pub table: RawTable<(K, V), A>,
191198
}
192199

193200
impl<K: Clone, V: Clone, S: Clone, A: Allocator + Clone> Clone for HashMap<K, V, S, A> {

0 commit comments

Comments
 (0)