-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bstr pulls in serde when serde
feature is not specified
#130
Comments
I tried this patch to diff --git i/Cargo.toml w/Cargo.toml
index b926066..aef244e 100644
--- i/Cargo.toml
+++ w/Cargo.toml
@@ -26,7 +26,6 @@ default = ["std", "unicode"]
std = ["alloc", "memchr/std", "serde?/std"]
alloc = ["serde?/alloc"]
unicode = ["dep:once_cell", "dep:regex-automata"]
-serde = ["dep:serde"]
[dependencies]
memchr = { version = "2.4.0", default-features = false } I wonder if this is an underspecified part of cargo's implementation of https://rust-lang.github.io/rfcs/3143-cargo-weak-namespaced-features.html where a weak feature appears at multiple levels of nested features. |
Hmm I tried with only [package]
name = "bstr-serde-feature-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bstr = { version = "1.0.0", default-features = false, features = ["alloc"] } And serde still shows up in the lockfile: # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "bstr"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11aee792a41973cf54c837d6f344e35a03076328831b01ef30a14d965d47bfbc"
dependencies = [
"memchr",
"serde",
]
[[package]]
name = "bstr-serde-feature-test"
version = "0.1.0"
dependencies = [
"bstr",
]
[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "serde"
version = "1.0.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" |
tbh I'm not sure this is even a bug, I just found it unexpected that entries appear in the lockfile that don't appear in |
Ok this might be rust-lang/cargo#10801. |
cc @epage |
Yeah this looks pretty unfortunate, but also definitely looks like a Cargo problem. (Maybe it's be design? I do kind of hope not to be honest. But I'm not sure.) I can at least say that when I use your I'm going to close this because it looks like it's definitively a Cargo thing. Thanks for flagging this! |
With this
Cargo.toml
:I get this lockfile:
However
cargo tree
doesn't showserde
in the dep tree at all:Meta
The text was updated successfully, but these errors were encountered: