summaryrefslogtreecommitdiff
path: root/examples/rust/src/tinywasm_no_std.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rust/src/tinywasm_no_std.rs')
-rw-r--r--examples/rust/src/tinywasm_no_std.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/rust/src/tinywasm_no_std.rs b/examples/rust/src/tinywasm_no_std.rs
index 9a31d20..46f1785 100644
--- a/examples/rust/src/tinywasm_no_std.rs
+++ b/examples/rust/src/tinywasm_no_std.rs
@@ -16,11 +16,11 @@ static ALLOCATOR: AssumeSingleThreaded<FreeListAllocator> =
unsafe { AssumeSingleThreaded::new(FreeListAllocator::new()) };
#[link(wasm_import_module = "env")]
-extern "C" {
+unsafe extern "C" {
fn printi32(x: i32);
}
-#[no_mangle]
+#[unsafe(no_mangle)]
pub extern "C" fn hello() {
let _ = run();
}
@@ -30,7 +30,7 @@ fn run() -> tinywasm::Result<()> {
let mut imports = tinywasm::Imports::new();
let res = tinywasm::parser::Parser::new().parse_module_bytes(include_bytes!("./print.wasm"))?;
- let twasm = res.serialize_twasm();
+ let twasm = res.serialize_twasm()?;
let module = tinywasm::Module::parse_bytes(&twasm)?;
imports.define(