mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 20:41:24 +00:00
Fix the anyref xform working on empty modules (#1861)
If there's no need for a transformation then there's no need to inject anything, so make sure that wasm-bindgen with anyref passes enabled works on non-wasm-bindgen blobs as well. Closes bytecodealliance/cargo-wasi#16
This commit is contained in:
@ -197,3 +197,39 @@ fn bin_crate_works() {
|
||||
.success()
|
||||
.stdout("hello, world\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty_interface_types() {
|
||||
let (mut cmd, _out_dir) = Project::new("empty_interface_types")
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#[no_mangle]
|
||||
pub extern fn foo() {}
|
||||
"#
|
||||
)
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
&format!(
|
||||
"
|
||||
[package]
|
||||
name = \"empty_interface_types\"
|
||||
authors = []
|
||||
version = \"1.0.0\"
|
||||
edition = '2018'
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen = {{ path = '{}' }}
|
||||
|
||||
[lib]
|
||||
crate-type = ['cdylib']
|
||||
|
||||
[workspace]
|
||||
",
|
||||
repo_root().display(),
|
||||
),
|
||||
)
|
||||
.wasm_bindgen("");
|
||||
cmd.env("WASM_INTERFACE_TYPES", "1");
|
||||
cmd.assert().success();
|
||||
}
|
||||
|
Reference in New Issue
Block a user