Open the-kenny opened 1 month ago
I don't think that is how our features set up. Do you have an example repo where you're seeing incorrect behaviour?
We use <dep>?/std
for our dependencies, which enables their std
features if those dependencies are already enabled.
If you're just seeing this in our Cargo.toml, then perhaps that is the cause of confusion?
I think this is probably related to how cargo
reports optional weak dependencies (e.g. metadata
). This is was previously discussed a little bit in regards to weak dependencies for Rust Decimal in issue #588.
The cargo lock behavior is further discussed within the cargo
project here: https://github.com/rust-lang/cargo/issues/10801
I think the key takeaways here:
cargo tree
should resolve the dependency tree correctly (please let us know if you have alternative results).cargo.lock
file may appear to include features not required due to the linked cargo issue.
db-tokio-postgres
depends onstd
which, according toREADME.md
, disablesno_std
support, but it seems to enable/include various optional dependencies.This happens because
db-tokio-postgres
depends on thestd
feature, which then activates the optional dependenciesborsh
,rand
,rkyv
,serde
andserde_json
.Is this intentional? I get that
db-tokio-postgres
can't work inno_std
, but why doesstd
have to enable therkyv
(and other) features?