Skip to content

Commit 2261681

Browse files
authored
avoid implicit Cargo features (rust-lang#2539)
* avoid implicit Cargo features * cargo sort
1 parent 83f729f commit 2261681

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@
190190
feature when depending on `bindgen` as a library.
191191
* Items are now parsed in the order they appear in source files. This may result in
192192
auto-generated `_bindgen_*` names having a different index.
193+
* Remove redundant Cargo features, which were all implicit:
194+
- bindgen-cli: `env_logger` and `log` removed in favor of `logging`
195+
- bindgen (lib):
196+
+ `log` removed in favor of `logging`
197+
+ `which` removed in favor of `which-logging`
198+
+ `annotate-snippets` removed in favor of `experimental`
193199

194200
## Removed
195201

bindgen-cli/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ name = "bindgen"
2121

2222
[dependencies]
2323
bindgen = { path = "../bindgen", version = "=0.65.1", features = ["__cli", "experimental"] }
24-
shlex = "1"
2524
clap = { version = "4", features = ["derive"] }
2625
clap_complete = "4"
2726
env_logger = { version = "0.10.0", optional = true }
2827
log = { version = "0.4", optional = true }
28+
shlex = "1"
2929

3030
[features]
3131
default = ["logging", "runtime", "which-rustfmt"]
32-
logging = ["bindgen/logging", "env_logger", "log"]
32+
logging = ["bindgen/logging", "dep:env_logger", "dep:log"]
3333
static = ["bindgen/static"]
3434
runtime = ["bindgen/runtime"]
3535
# Dynamically discover a `rustfmt` binary using the `which` crate

bindgen-tests/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ publish = false
66

77
[dev-dependencies]
88
bindgen = { path = "../bindgen", features = ["__cli", "experimental"] }
9-
diff = "0.1"
10-
shlex = "1"
119
clap = { version = "4", features = ["derive"] }
1210
clap_complete = "4"
11+
diff = "0.1"
12+
shlex = "1"
1313
prettyplease = { version = "0.2.0" }
1414
syn = { version = "2.0" }
1515
tempfile = "3"

bindgen-tests/tests/expectations/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ authors = [
1010
edition = "2018"
1111

1212
[dependencies]
13-
objc = "0.2"
1413
block = "0.1"
1514
libloading = "0.7"
15+
objc = "0.2"

bindgen/Cargo.toml

+12-12
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ name = "bindgen"
2525
path = "lib.rs"
2626

2727
[dependencies]
28+
annotate-snippets = { version = "0.9.1", features = ["color"], optional = true }
2829
bitflags = "2.2.1"
2930
cexpr = "0.6"
3031
clang-sys = { version = "1", features = ["clang_6_0"] }
31-
lazycell = "1"
3232
lazy_static = "1"
33+
lazycell = "1"
34+
log = { version = "0.4", optional = true }
3335
peeking_take_while = "0.1.2"
34-
quote = { version = "1", default-features = false }
35-
syn = { version = "2.0", features = ["full", "extra-traits", "visit-mut"]}
36-
regex = { version = "1.5", default-features = false , features = ["std", "unicode"] }
37-
which = { version = "4.2.1", optional = true, default-features = false }
3836
prettyplease = { version = "0.2.0", optional = true }
39-
annotate-snippets = { version = "0.9.1", features = ["color"], optional = true }
40-
shlex = "1"
41-
rustc-hash = "1.0.1"
4237
proc-macro2 = { version = "1", default-features = false }
43-
log = { version = "0.4", optional = true }
38+
quote = { version = "1", default-features = false }
39+
regex = { version = "1.5", default-features = false, features = ["std", "unicode"] }
40+
rustc-hash = "1.0.1"
41+
shlex = "1"
42+
syn = { version = "2.0", features = ["full", "extra-traits", "visit-mut"] }
43+
which = { version = "4.2.1", optional = true, default-features = false }
4444

4545
[features]
4646
default = ["logging", "prettyplease", "runtime", "which-rustfmt"]
47-
logging = ["log"]
47+
logging = ["dep:log"]
4848
static = ["clang-sys/static"]
4949
runtime = ["clang-sys/runtime"]
5050
# Dynamically discover a `rustfmt` binary using the `which` crate
51-
which-rustfmt = ["which"]
52-
experimental = ["annotate-snippets"]
51+
which-rustfmt = ["dep:which"]
52+
experimental = ["dep:annotate-snippets"]
5353

5454
## The following features are for internal use and they shouldn't be used if
5555
## you're not hacking on bindgen

0 commit comments

Comments
 (0)