diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.Fast.cs b/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.Fast.cs index 967459e4b743..01c98eeb0ec1 100644 --- a/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.Fast.cs +++ b/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.Fast.cs @@ -50,6 +50,7 @@ public static Memory AsMemory(ReadOnlyMemory readOnlyMemory) => /// /// Thrown when or contains pointers. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Span Cast(Span source) where TFrom : struct where TTo : struct @@ -75,6 +76,7 @@ ref Unsafe.As(ref source._pointer.Value), /// /// Thrown when or contains pointers. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ReadOnlySpan Cast(ReadOnlySpan source) where TFrom : struct where TTo : struct