Open gootorov opened 8 months ago
cc @zakarumych
Your help may be needed here
This was kinda expected issue when one crate turns on nightly for allocator-api2 and another one does not.
The workaround is add direct dependency to the crate that does not enable "nightly" and make it enable the feature.
Hi
When using certain crates (repro below) it is possible for
hashbrown
to fail to compile, even though it is a transitive dependency.To reproduce, create a new crate:
cargo new --lib hashbrown_issue
With the followingCargo.toml
:And the following
src/lib.rs
:Then, attempt to compile:
cargo +nightly build
. This produces a lot of similar errors:The toolchain used is
cargo 1.75.0-nightly (7046d992f 2023-11-08)
.This might be related to #417. To be honest, I'm not too sure whether the issue should be opened in
hashbrown
, orsqlx
/blink-alloc
/allocator-api2
.Possible workarounds
hashbrown = { version = "0.14.2", features = ["nightly"] }
toCargo.toml
resolves the issue. Even ifhashbrown
is not used as a direct dependency. However, this is undesirable as it enables a lot of unstable features inhashbrown
. Limiting to#![feature(allocator_api)]
is preferable.blink-alloc
withbumpalo = { version = "3.14.0", features = ["allocator_api"] }
also works.