public static void PortableCastToTypeContainsReferences() { Span<uint> span = new Span<uint>(Array.Empty<uint>()); AssertThrows<ArgumentException, uint>(span, (_span) => _span.NonPortableCast<uint, StructWithReferences>().DontBox()); }