Skip to content

Commit 74beecf

Browse files
Merge pull request bytecodealliance#134 from NukeManDan/update-wit-bindgen
Update to wit-bindgen-rt 0.23.0
2 parents 23d3a28 + ae223be commit 74beecf

File tree

9 files changed

+59
-26
lines changed

9 files changed

+59
-26
lines changed

component-model/examples/tutorial/adder/Cargo.lock

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component-model/examples/tutorial/adder/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
bitflags = "2.4.2"
8-
wit-bindgen-rt = "0.20.0"
8+
wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] }
99

1010
[lib]
1111
crate-type = ["cdylib"]

component-model/examples/tutorial/adder/src/bindings.rs

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT!
1+
// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT!
22
// Options used:
3+
#[allow(dead_code)]
34
pub mod exports {
5+
#[allow(dead_code)]
46
pub mod docs {
7+
#[allow(dead_code)]
58
pub mod calculator {
6-
#[allow(clippy::all)]
9+
#[allow(dead_code, clippy::all)]
710
pub mod add {
811
#[used]
912
#[doc(hidden)]
@@ -14,6 +17,8 @@ pub mod exports {
1417
#[doc(hidden)]
1518
#[allow(non_snake_case)]
1619
pub unsafe fn _export_add_cabi<T: Guest>(arg0: i32, arg1: i32) -> i32 {
20+
#[cfg(target_arch = "wasm32")]
21+
_rt::run_ctors_once();
1722
let result0 = T::add(arg0 as u32, arg1 as u32);
1823
_rt::as_i32(result0)
1924
}
@@ -39,6 +44,11 @@ pub mod exports {
3944
}
4045
mod _rt {
4146

47+
#[cfg(target_arch = "wasm32")]
48+
pub fn run_ctors_once() {
49+
wit_bindgen_rt::run_ctors_once();
50+
}
51+
4252
pub fn as_i32<T: AsI32>(t: T) -> i32 {
4353
t.as_i32()
4454
}
@@ -139,14 +149,14 @@ macro_rules! __export_adder_impl {
139149
pub(crate) use __export_adder_impl as export;
140150

141151
#[cfg(target_arch = "wasm32")]
142-
#[link_section = "component-type:wit-bindgen:0.21.0:adder:encoded world"]
152+
#[link_section = "component-type:wit-bindgen:0.24.0:adder:encoded world"]
143153
#[doc(hidden)]
144154
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 213] = *b"\
145155
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07Z\x01A\x02\x01A\x02\x01\
146156
B\x02\x01@\x02\x01ay\x01by\0y\x04\0\x03add\x01\0\x04\x01\x19docs:calculator/add@\
147157
0.1.0\x05\0\x04\x01\x1bdocs:calculator/[email protected]\x04\0\x0b\x0b\x01\0\x05adder\x03\
148-
\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-\
149-
bindgen-rust\x060.21.0";
158+
\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-\
159+
bindgen-rust\x060.24.0";
150160

151161
#[inline(never)]
152162
#[doc(hidden)]

component-model/examples/tutorial/calculator/Cargo.lock

+7-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component-model/examples/tutorial/calculator/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
bitflags = "2.4.2"
8-
wit-bindgen-rt = "0.20.0"
8+
wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] }
99

1010
[lib]
1111
crate-type = ["cdylib"]

component-model/examples/tutorial/calculator/src/bindings.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT!
1+
// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT!
22
// Options used:
3+
#[allow(dead_code)]
34
pub mod docs {
5+
#[allow(dead_code)]
46
pub mod calculator {
5-
#[allow(clippy::all)]
7+
#[allow(dead_code, clippy::all)]
68
pub mod add {
79
#[used]
810
#[doc(hidden)]
@@ -31,10 +33,13 @@ pub mod docs {
3133
}
3234
}
3335
}
36+
#[allow(dead_code)]
3437
pub mod exports {
38+
#[allow(dead_code)]
3539
pub mod docs {
40+
#[allow(dead_code)]
3641
pub mod calculator {
37-
#[allow(clippy::all)]
42+
#[allow(dead_code, clippy::all)]
3843
pub mod calculate {
3944
#[used]
4045
#[doc(hidden)]
@@ -76,6 +81,8 @@ pub mod exports {
7681
arg1: i32,
7782
arg2: i32,
7883
) -> i32 {
84+
#[cfg(target_arch = "wasm32")]
85+
_rt::run_ctors_once();
7986
let result0 =
8087
T::eval_expression(Op::_lift(arg0 as u8), arg1 as u32, arg2 as u32);
8188
_rt::as_i32(result0)
@@ -171,6 +178,11 @@ mod _rt {
171178
self as i32
172179
}
173180
}
181+
182+
#[cfg(target_arch = "wasm32")]
183+
pub fn run_ctors_once() {
184+
wit_bindgen_rt::run_ctors_once();
185+
}
174186
}
175187

176188
/// Generates `#[no_mangle]` functions to export the specified type as the
@@ -202,7 +214,7 @@ macro_rules! __export_calculator_impl {
202214
pub(crate) use __export_calculator_impl as export;
203215

204216
#[cfg(target_arch = "wasm32")]
205-
#[link_section = "component-type:wit-bindgen:0.21.0:calculator:encoded world"]
217+
#[link_section = "component-type:wit-bindgen:0.24.0:calculator:encoded world"]
206218
#[doc(hidden)]
207219
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 313] = *b"\
208220
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xb8\x01\x01A\x02\x01\
@@ -211,7 +223,7 @@ ator/[email protected]\x05\0\x01B\x04\x01m\x01\x03add\x04\0\x02op\x03\0\0\x01@\x03\x02op
211223
\x01\x01xy\x01yy\0y\x04\0\x0feval-expression\x01\x02\x04\x01\x1fdocs:calculator/\
212224
[email protected]\x05\x01\x04\x01\x20docs:calculator/[email protected]\x04\0\x0b\x10\
213225
\x01\0\x0acalculator\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-comp\
214-
onent\x070.201.0\x10wit-bindgen-rust\x060.21.0";
226+
onent\x070.202.0\x10wit-bindgen-rust\x060.24.0";
215227

216228
#[inline(never)]
217229
#[doc(hidden)]

component-model/examples/tutorial/command/Cargo.lock

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component-model/examples/tutorial/command/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ world = "app"
1414
anyhow = "1"
1515
clap = { version = "4.3.19", features = ["derive"] }
1616
bitflags = "2.4.2"
17-
wit-bindgen-rt = "0.20.0"
17+
wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] }

component-model/examples/tutorial/command/src/bindings.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT!
1+
// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT!
22
// Options used:
3+
#[allow(dead_code)]
34
pub mod docs {
5+
#[allow(dead_code)]
46
pub mod calculator {
5-
#[allow(clippy::all)]
7+
#[allow(dead_code, clippy::all)]
68
pub mod calculate {
79
#[used]
810
#[doc(hidden)]
@@ -132,15 +134,15 @@ mod _rt {
132134
}
133135

134136
#[cfg(target_arch = "wasm32")]
135-
#[link_section = "component-type:wit-bindgen:0.21.0:app:encoded world"]
137+
#[link_section = "component-type:wit-bindgen:0.24.0:app:encoded world"]
136138
#[doc(hidden)]
137139
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 246] = *b"\
138140
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07}\x01A\x02\x01A\x02\x01\
139141
B\x04\x01m\x01\x03add\x04\0\x02op\x03\0\0\x01@\x03\x02op\x01\x01xy\x01yy\0y\x04\0\
140142
\x0feval-expression\x01\x02\x03\x01\x1fdocs:calculator/[email protected]\x05\0\x04\
141143
\x01\x19docs:calculator/[email protected]\x04\0\x0b\x09\x01\0\x03app\x03\0\0\0G\x09produ\
142-
cers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x06\
143-
0.21.0";
144+
cers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rust\x06\
145+
0.24.0";
144146

145147
#[inline(never)]
146148
#[doc(hidden)]

0 commit comments

Comments
 (0)