| 771 | |
| 772 | #[test] |
| 773 | fn structref_to_eqref_rooted() -> Result<()> { |
| 774 | let mut store = gc_store()?; |
| 775 | let struct_ty = StructType::new( |
| 776 | store.engine(), |
| 777 | [FieldType::new(Mutability::Const, ValType::I32.into())], |
| 778 | )?; |
| 779 | let pre = StructRefPre::new(&mut store, struct_ty); |
| 780 | let s = StructRef::new(&mut store, &pre, &[Val::I32(10)])?; |
| 781 | |
| 782 | // Rooted<StructRef>::to_eqref upcast |
| 783 | let eq: Rooted<EqRef> = s.to_eqref(); |
| 784 | assert!(eq.is_struct(&store)?); |
| 785 | |
| 786 | Ok(()) |
| 787 | } |
| 788 | |
| 789 | #[test] |
| 790 | fn structref_owned_to_anyref() -> Result<()> { |