summaryrefslogtreecommitdiff
path: root/examples/wasm-rust.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wasm-rust.rs')
-rw-r--r--examples/wasm-rust.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/examples/wasm-rust.rs b/examples/wasm-rust.rs
index b3398f8..0cfb0ce 100644
--- a/examples/wasm-rust.rs
+++ b/examples/wasm-rust.rs
@@ -35,7 +35,6 @@ fn main() -> Result<()> {
println!(" host_fn");
println!(" fibonacci - calculate fibonacci(30)");
println!(" tinywasm - run printi32 inside of tinywasm inside of itself");
- println!(" tinywasm_precompiled - run a precompiled module inside of tinywasm");
println!(" tinywasm_no_std - run a precompiled module inside of no_std tinywasm");
println!(" argon2id - run argon2id(1000, 2, 1)");
return Ok(());
@@ -46,7 +45,6 @@ fn main() -> Result<()> {
"printi32" => printi32()?,
"fibonacci" => fibonacci()?,
"tinywasm" => tinywasm()?,
- "tinywasm_precompiled" => tinywasm_precompiled()?,
"tinywasm_no_std" => tinywasm_no_std()?,
"argon2id" => argon2id()?,
"host_fn" => host_fn()?,
@@ -60,8 +58,6 @@ fn main() -> Result<()> {
fibonacci()?;
println!("\ntinywasm.wasm:");
tinywasm()?;
- println!("\ntinywasm_precompiled.wasm:");
- tinywasm_precompiled()?;
println!("\ntinywasm_no_std.wasm:");
tinywasm_no_std()?;
println!("argon2id.wasm:");
@@ -105,21 +101,6 @@ fn tinywasm_no_std() -> Result<()> {
Ok(())
}
-fn tinywasm_precompiled() -> Result<()> {
- let module = tinywasm::parse_file("./examples/rust/out/tinywasm_precompiled.opt.wasm")?;
- let mut store = Store::default();
-
- let mut imports = Imports::new();
- imports.define("env", "printi32", HostFunction::from(|_: FuncContext<'_>, _x: i32| Ok(())));
- let instance = ModuleInstance::instantiate(&mut store, &module, Some(black_box(&imports)))?;
-
- let hello = instance.func::<(), ()>(&store, "hello")?;
- hello.call(&mut store, black_box(()))?;
- hello.call(&mut store, black_box(()))?;
- hello.call(&mut store, black_box(()))?;
- Ok(())
-}
-
fn hello() -> Result<()> {
let module = tinywasm::parse_file("./examples/rust/out/hello.opt.wasm")?;
let mut store = Store::default();
@@ -232,11 +213,6 @@ mod tests {
}
#[test]
- fn test_tinywasm_precompiled() {
- tinywasm_precompiled().unwrap();
- }
-
- #[test]
fn test_tinywasm_no_std() {
tinywasm_no_std().unwrap();
}