Skip to content

Commit f2c3e9f

Browse files
authored
Remove async feature of wit-bindgen-rust-macros (#1595)
This removes the `async` feature which is purely used for an error message and that's it. While the error message is useful the way that the feature is activated results in an unfortunate interaction with Cargo dependencies and how lock files are generated. Notably the conditional `a?/b` syntax means that even when a Cargo feature is disabled the full dependency tree shows up in lock files (for now). The dependency tree of `wit-bindgen-rust-macros` is quite large, which is why it's an optional feature, so this is undesirable.
1 parent 8e9087b commit f2c3e9f

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

crates/guest-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ default = ["macros", "realloc", "async", "std", "bitflags", "macro-string"]
3838
macros = ["dep:wit-bindgen-rust-macro"]
3939
realloc = []
4040
std = []
41-
async = ["wit-bindgen-rust-macro?/async"]
41+
async = []
4242
bitflags = ["dep:bitflags"]
4343
async-spawn = ['async', 'dep:futures', 'std']
4444
futures-stream = ['async', 'dep:futures']

crates/guest-rust/macro/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ macro-string = { workspace = true, optional = true }
2727

2828
[features]
2929
default = ["macro-string"]
30-
async = []
3130
macro-string = ["dep:macro-string"]

crates/guest-rust/macro/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ impl Parse for Config {
163163
return Err(Error::new(span, "cannot specify second async config"));
164164
}
165165
async_configured = true;
166-
if val.any_enabled() && !cfg!(feature = "async") {
167-
return Err(Error::new(
168-
span,
169-
"must enable `async` feature to enable async imports and/or exports",
170-
));
171-
}
172166
opts.async_ = val;
173167
}
174168
Opt::EnableMethodChaining(enable) => {

0 commit comments

Comments
 (0)