Skip to content

Commit

Permalink
Merge branch 'main' of github.com:bytecodealliance/wit-bindgen into w…
Browse files Browse the repository at this point in the history
…asmfx-merge
  • Loading branch information
dhil committed Mar 13, 2024
2 parents 4aedf77 + 9c913f6 commit 4d0e37e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 26 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.21.0"
version = "0.22.0"

[workspace.dependencies]
anyhow = "1.0.72"
Expand All @@ -35,14 +35,14 @@ wasm-encoder = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-
wit-parser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
wit-component = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }

wit-bindgen-core = { path = 'crates/core', version = '0.21.0' }
wit-bindgen-c = { path = 'crates/c', version = '0.21.0' }
wit-bindgen-rust = { path = "crates/rust", version = "0.21.0" }
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.21.0' }
wit-bindgen-go = { path = 'crates/go', version = '0.21.0' }
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.21.0' }
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.21.0' }
wit-bindgen = { path = 'crates/guest-rust', version = '0.21.0', default-features = false }
wit-bindgen-core = { path = 'crates/core', version = '0.22.0' }
wit-bindgen-c = { path = 'crates/c', version = '0.22.0' }
wit-bindgen-rust = { path = "crates/rust", version = "0.22.0" }
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.22.0' }
wit-bindgen-go = { path = 'crates/go', version = '0.22.0' }
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.22.0' }
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.22.0' }
wit-bindgen = { path = 'crates/guest-rust', version = '0.22.0', default-features = false }

[[bin]]
name = "wit-bindgen"
Expand Down
4 changes: 2 additions & 2 deletions crates/guest-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Used when compiling Rust programs to the component model.
"""

[dependencies]
wit-bindgen-rust-macro = { path = "./macro", optional = true, version = "0.21.0" }
wit-bindgen-rt = { path = "./rt", optional = true, version = "0.21.0" }
wit-bindgen-rust-macro = { path = "./macro", optional = true, version = "0.22.0" }
wit-bindgen-rt = { path = "./rt", optional = true, version = "0.22.0" }
bitflags = { workspace = true }

[features]
Expand Down
4 changes: 2 additions & 2 deletions crates/guest-rust/rt/src/cabi_realloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <stdint.h>

extern void *cabi_realloc_wit_bindgen_0_21_0(void *ptr, size_t old_size, size_t align, size_t new_size);
extern void *cabi_realloc_wit_bindgen_0_22_0(void *ptr, size_t old_size, size_t align, size_t new_size);

__attribute__((__weak__, __export_name__("cabi_realloc")))
void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size) {
return cabi_realloc_wit_bindgen_0_21_0(ptr, old_size, align, new_size);
return cabi_realloc_wit_bindgen_0_22_0(ptr, old_size, align, new_size);
}
Binary file modified crates/guest-rust/rt/src/cabi_realloc.o
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/guest-rust/rt/src/cabi_realloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is generated by ./ci/rebuild-libcabi-realloc.sh

#[no_mangle]
pub unsafe extern "C" fn cabi_realloc_wit_bindgen_0_21_0(
pub unsafe extern "C" fn cabi_realloc_wit_bindgen_0_22_0(
old_ptr: *mut u8,
old_len: usize,
align: usize,
Expand Down
Binary file modified crates/guest-rust/rt/src/libwit_bindgen_cabi_realloc.a
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ fn perform_cast(operand: &str, cast: &Bitcast) -> String {
// Convert a `MaybeUninit<u64>` holding a pointer value back into
// the pointer value.
Bitcast::P64ToP => {
format!("{}.as_mut_ptr().cast::<*mut u8>().read()", operand)
format!("{}.as_ptr().cast::<*mut u8>().read()", operand)
}
// Convert an `i32` or a `usize` into a pointer.
Bitcast::I32ToP | Bitcast::LToP => {
Expand Down
6 changes: 6 additions & 0 deletions tests/codegen/variants-unioning-types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,10 @@ world a {
b(f32),
}
import f-s64-f32: func(x: v-s64-f32);

variant v-string-u64 {
a(string),
b(u64),
}
export f-string-u64: func(x: v-string-u64);
}

0 comments on commit 4d0e37e

Please sign in to comment.