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

Function structref_ty

tests/all/structs.rs:828–841  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

826
827#[test]
828fn structref_ty() -> Result<()> {
829 let mut store = gc_store()?;
830 let struct_ty = StructType::new(
831 store.engine(),
832 [FieldType::new(Mutability::Const, ValType::I32.into())],
833 )?;
834 let pre = StructRefPre::new(&mut store, struct_ty.clone());
835 let s = StructRef::new(&mut store, &pre, &[Val::I32(99)])?;
836
837 let ty = s.ty(&store)?;
838 assert!(ty.matches(&struct_ty));
839
840 Ok(())
841}
842
843#[test]
844fn structref_matches_ty() -> Result<()> {

Callers

nothing calls this directly

Calls 6

gc_storeFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
engineMethod · 0.45
cloneMethod · 0.45
tyMethod · 0.45

Tested by

no test coverage detected