Skip to content

Commit 5a42b7c

Browse files
committed
fix non-component-model-async build; appease clippy
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent ce6395f commit 5a42b7c

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

crates/test-programs/src/bin/async_poll.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn task_poll() -> Option<(i32, i32, i32)> {
1919
#[cfg(target_arch = "wasm32")]
2020
{
2121
#[link(wasm_import_module = "$root")]
22-
extern "C" {
22+
unsafe extern "C" {
2323
#[link_name = "[task-poll]"]
2424
fn poll(_: *mut i32) -> i32;
2525
}
@@ -41,7 +41,7 @@ fn async_when_ready() -> i32 {
4141
#[cfg(target_arch = "wasm32")]
4242
{
4343
#[link(wasm_import_module = "local:local/ready")]
44-
extern "C" {
44+
unsafe extern "C" {
4545
#[link_name = "[async]when-ready"]
4646
fn call_when_ready(_: *mut u8, _: *mut u8) -> i32;
4747
}
@@ -60,7 +60,7 @@ fn subtask_drop(subtask: u32) {
6060
#[cfg(target_arch = "wasm32")]
6161
{
6262
#[link(wasm_import_module = "$root")]
63-
extern "C" {
63+
unsafe extern "C" {
6464
#[link_name = "[subtask-drop]"]
6565
fn subtask_drop(_: u32);
6666
}

crates/test-programs/src/bin/async_round_trip_stackful.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,45 @@ use std::alloc::{self, Layout};
1515

1616
#[cfg(target_arch = "wasm32")]
1717
#[link(wasm_import_module = "[export]local:local/baz")]
18-
extern "C" {
18+
unsafe extern "C" {
1919
#[link_name = "[task-return]foo"]
2020
fn task_return_foo(ptr: *mut u8, len: usize);
2121
}
2222
#[cfg(not(target_arch = "wasm32"))]
23-
extern "C" fn task_return_foo(_ptr: *mut u8, _len: usize) {
23+
unsafe extern "C" fn task_return_foo(_ptr: *mut u8, _len: usize) {
2424
unreachable!()
2525
}
2626

2727
#[cfg(target_arch = "wasm32")]
2828
#[link(wasm_import_module = "local:local/baz")]
29-
extern "C" {
29+
unsafe extern "C" {
3030
#[link_name = "[async]foo"]
3131
fn import_foo(params: *mut u8, results: *mut u8) -> u32;
3232
}
3333
#[cfg(not(target_arch = "wasm32"))]
34-
extern "C" fn import_foo(_params: *mut u8, _results: *mut u8) -> u32 {
34+
unsafe extern "C" fn import_foo(_params: *mut u8, _results: *mut u8) -> u32 {
3535
unreachable!()
3636
}
3737

3838
#[cfg(target_arch = "wasm32")]
3939
#[link(wasm_import_module = "$root")]
40-
extern "C" {
40+
unsafe extern "C" {
4141
#[link_name = "[task-wait]"]
4242
fn task_wait(results: *mut i32) -> i32;
4343
}
4444
#[cfg(not(target_arch = "wasm32"))]
45-
extern "C" fn task_wait(_results: *mut i32) -> i32 {
45+
unsafe extern "C" fn task_wait(_results: *mut i32) -> i32 {
4646
unreachable!()
4747
}
4848

4949
#[cfg(target_arch = "wasm32")]
5050
#[link(wasm_import_module = "$root")]
51-
extern "C" {
51+
unsafe extern "C" {
5252
#[link_name = "[subtask-drop]"]
5353
fn subtask_drop(task: u32);
5454
}
5555
#[cfg(not(target_arch = "wasm32"))]
56-
extern "C" fn subtask_drop(_task: u32) {
56+
unsafe extern "C" fn subtask_drop(_task: u32) {
5757
unreachable!()
5858
}
5959

@@ -117,7 +117,7 @@ unsafe extern "C" fn export_foo(ptr: *mut u8, len: usize) {
117117

118118
// Copied from `wit-bindgen`-generated output
119119
#[cfg(target_arch = "wasm32")]
120-
#[link_section = "component-type:wit-bindgen:0.35.0:local:local:round-trip:encoded world"]
120+
#[unsafe(link_section = "component-type:wit-bindgen:0.35.0:local:local:round-trip:encoded world")]
121121
#[doc(hidden)]
122122
#[allow(
123123
clippy::octal_escapes,

crates/wasmtime/src/runtime/component/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ pub(crate) mod concurrent {
803803
pub(crate) extern "C" fn async_exit<T>(
804804
_cx: *mut VMOpaqueContext,
805805
_callback: *mut VMFuncRef,
806+
_post_return: *mut VMFuncRef,
806807
_caller_instance: RuntimeComponentInstanceIndex,
807808
_callee: *mut VMFuncRef,
808809
_callee_instance: RuntimeComponentInstanceIndex,

0 commit comments

Comments
 (0)