Skip to content

Commit

Permalink
Deprecate the raw entry API in favor of HashTable
Browse files Browse the repository at this point in the history
It is now moved under the "raw-entry" Cargo feature.

For now the raw-entry feature is kept enabled by default because
`HashSet` uses it internally, but this will be disabled by default once
this is no longer the case.
  • Loading branch information
Amanieu committed Jun 19, 2024
1 parent 4c824c5 commit c4ebfae
Show file tree
Hide file tree
Showing 6 changed files with 1,849 additions and 1,824 deletions.
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bumpalo = { version = "3.13.0", features = ["allocator-api2"] }
rkyv = { version = "0.7.42", features = ["validation"] }

[features]
default = ["default-hasher", "inline-more", "allocator-api2", "equivalent"]
default = ["default-hasher", "inline-more", "allocator-api2", "equivalent", "raw-entry"]

# Enables use of nightly features. This is only guaranteed to work on the latest
# version of nightly Rust.
Expand All @@ -64,11 +64,15 @@ rustc-dep-of-std = [
"compiler_builtins",
"alloc",
"rustc-internal-api",
"raw-entry",
]

# Enables the RawTable API.
# Enables the experimental and unsafe RawTable API.
raw = []

# Enables the deprecated RawEntry API.
raw-entry = []

# Provides a default hasher. Currently this is AHash but this is subject to
# change in the future. Note that the default hasher does *not* provide HashDoS
# resistance, unlike the one in the standard library.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ This crate has the following Cargo features:
- `rayon`: Enables rayon parallel iterator support.
- `equivalent`: Allows comparisons to be customized with the `Equivalent` trait.
- `raw`: Enables access to the experimental and unsafe `RawTable` API.
- `raw-entry`: Enables access to the deprecated `RawEntry` API.
- `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost
of compilation time. (enabled by default)
- `default-hasher`: Compiles with ahash as default hasher. (enabled by default)
Expand Down
4 changes: 2 additions & 2 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ if [ "${CHANNEL}" = "nightly" ]; then
fi

# Make sure we can compile without the default hasher
"${CARGO}" -vv build --target="${TARGET}" --no-default-features
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features
"${CARGO}" -vv build --target="${TARGET}" --no-default-features --features raw-entry
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features --features raw-entry

"${CARGO}" -vv ${OP} --target="${TARGET}"
"${CARGO}" -vv ${OP} --target="${TARGET}" --features "${FEATURES}"
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ mod raw;

mod external_trait_impls;
mod map;
#[cfg(feature = "raw-entry")]
mod raw_entry;
#[cfg(feature = "rustc-internal-api")]
mod rustc_entry;
mod scopeguard;
Expand Down
Loading

0 comments on commit c4ebfae

Please sign in to comment.