MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / allow_unknown_exports

Function allow_unknown_exports

tests/all/linker.rs:195–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193#[test]
194#[cfg_attr(miri, ignore)]
195fn allow_unknown_exports() -> Result<()> {
196 let mut store = Store::<()>::default();
197 let mut linker = Linker::new(store.engine());
198 let module = Module::new(
199 store.engine(),
200 r#"(module (func (export "_start")) (global (export "g") i32 (i32.const 0)))"#,
201 )?;
202
203 assert!(linker.module(&mut store, "module", &module).is_err());
204
205 let mut linker = Linker::new(store.engine());
206 linker.allow_unknown_exports(true);
207 linker.module(&mut store, "module", &module)?;
208
209 Ok(())
210}
211
212#[test]
213#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 5

OkFunction · 0.85
allow_unknown_exportsMethod · 0.80
newFunction · 0.50
engineMethod · 0.45
moduleMethod · 0.45

Tested by

no test coverage detected