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

Function arrayref_owned_to_eqref

tests/all/arrays.rs:936–952  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

934
935#[test]
936fn arrayref_owned_to_eqref() -> Result<()> {
937 let mut store = gc_store()?;
938 let array_ty = ArrayType::new(
939 store.engine(),
940 FieldType::new(Mutability::Const, ValType::I32.into()),
941 );
942 let pre = ArrayRefPre::new(&mut store, array_ty);
943 let a = ArrayRef::new(&mut store, &pre, &Val::I32(5), 1)?;
944 let owned = a.to_owned_rooted(&mut store)?;
945
946 // OwnedRooted<ArrayRef>::to_eqref
947 let eq_owned: OwnedRooted<EqRef> = owned.to_eqref();
948 let eq = eq_owned.to_rooted(&mut store);
949 assert!(eq.is_array(&store)?);
950
951 Ok(())
952}
953
954#[test]
955fn arrayref_ty() -> Result<()> {

Callers

nothing calls this directly

Calls 7

gc_storeFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
engineMethod · 0.45
to_owned_rootedMethod · 0.45
to_eqrefMethod · 0.45
to_rootedMethod · 0.45

Tested by

no test coverage detected