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

Function anyref_ty_struct

tests/all/gc.rs:2535–2547  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2533
2534#[test]
2535fn anyref_ty_struct() -> Result<()> {
2536 let mut store = gc_store()?;
2537 let struct_ty = StructType::new(
2538 store.engine(),
2539 [FieldType::new(Mutability::Const, ValType::I32.into())],
2540 )?;
2541 let pre = StructRefPre::new(&mut store, struct_ty);
2542 let s = StructRef::new(&mut store, &pre, &[Val::I32(0)])?;
2543 let any: Rooted<AnyRef> = s.into();
2544 let ty = any.ty(&store)?;
2545 assert!(matches!(ty, HeapType::ConcreteStruct(_)));
2546 Ok(())
2547}
2548
2549#[test]
2550fn anyref_ty_extern_converted() -> Result<()> {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected