Skip to content

Commit

Permalink
Rename cli feature to __cli (rust-lang#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz authored Mar 24, 2023
1 parent 0de11f0 commit 4d2986c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bindgen-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ path = "main.rs"
name = "bindgen"

[dependencies]
bindgen = { path = "../bindgen", version = "=0.64.0", features = ["cli", "experimental"] }
bindgen = { path = "../bindgen", version = "=0.64.0", features = ["__cli", "experimental"] }
shlex = "1"
clap = { version = "4", features = ["derive"] }
env_logger = { version = "0.10.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bindgen-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.1.0"
publish = false

[dev-dependencies]
bindgen = { path = "../bindgen", features = ["cli", "experimental"] }
bindgen = { path = "../bindgen", features = ["__cli", "experimental"] }
diff = "0.1"
shlex = "1"
clap = { version = "4", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static = ["clang-sys/static"]
runtime = ["clang-sys/runtime"]
# Dynamically discover a `rustfmt` binary using the `which` crate
which-rustfmt = ["which"]
cli = []
__cli = []
experimental = []

# These features only exist for CI testing -- don't use them if you're not hacking
Expand Down
2 changes: 1 addition & 1 deletion bindgen/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Default for MacroParsingBehavior {
/// A trait to allow configuring different kinds of types in different
/// situations.
pub trait ParseCallbacks: fmt::Debug {
#[cfg(feature = "cli")]
#[cfg(feature = "__cli")]
#[doc(hidden)]
fn cli_args(&self) -> Vec<String> {
vec![]
Expand Down
8 changes: 4 additions & 4 deletions bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ impl Builder {
input_headers,
// These cannot be added from the CLI.
input_header_contents: _,
#[cfg(feature = "cli")]
#[cfg(feature = "__cli")]
parse_callbacks,
// ParseCallbacks cannot represent CLI flags if the `"cli"` feature is disabled.
#[cfg(not(feature = "cli"))]
// ParseCallbacks cannot represent CLI flags if the `"__cli"` feature is disabled.
#[cfg(not(feature = "__cli"))]
parse_callbacks: _,
codegen_config,
conservative_inline_namespaces,
Expand Down Expand Up @@ -794,7 +794,7 @@ impl Builder {
output_vector.push("--wrap-unsafe-ops".into());
}

#[cfg(feature = "cli")]
#[cfg(feature = "__cli")]
for callbacks in parse_callbacks {
output_vector.extend(callbacks.cli_args());
}
Expand Down

0 comments on commit 4d2986c

Please sign in to comment.