Skip to content

Commit

Permalink
Remove IDE0060 suppressions (#99113)
Browse files Browse the repository at this point in the history
Issue resolved in `Microsoft.CodeAnalysis.CSharp.CodeStyle` 4.5.0-3.22613.20
  • Loading branch information
xtqqczze authored Mar 1, 2024
1 parent da197df commit 049da22
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/libraries/System.Private.CoreLib/src/System/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ internal static void BulkMoveWithWriteBarrier(ref byte destination, ref byte sou
_BulkMoveWithWriteBarrier(ref destination, ref source, byteCount);
}

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228
// Non-inlinable wrapper around the loop for copying large blocks in chunks
[MethodImpl(MethodImplOptions.NoInlining)]
private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount)
Expand Down Expand Up @@ -220,7 +219,6 @@ private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte sou
}
__BulkMoveWithWriteBarrier(ref destination, ref source, byteCount);
}
#pragma warning restore IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

#endif // !MONO
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ public ReadOnlySpan(ref readonly T reference)
_length = 1;
}

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228
// Constructor for internal use only. It is not safe to expose publicly, and is instead exposed via the unsafe MemoryMarshal.CreateReadOnlySpan.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal ReadOnlySpan(ref T reference, int length)
Expand All @@ -130,7 +129,6 @@ internal ReadOnlySpan(ref T reference, int length)
_reference = ref reference;
_length = length;
}
#pragma warning restore IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

/// <summary>
/// Returns the specified element of the read-only span.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static Memory<T> AsMemory<T>(ReadOnlyMemory<T> memory) =>
/// </summary>
public static ref T GetReference<T>(ReadOnlySpan<T> span) => ref span._reference;

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228
/// <summary>
/// Returns a reference to the 0th element of the Span. If the Span is empty, returns a reference to fake non-null pointer. Such a reference can be used
/// for pinning but must never be dereferenced. This is useful for interop with methods that do not accept null pointers for zero-sized buffers.
Expand All @@ -101,7 +100,6 @@ public static Memory<T> AsMemory<T>(ReadOnlyMemory<T> memory) =>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe ref T GetNonNullPinnableReference<T>(ReadOnlySpan<T> span) => ref (span.Length != 0) ? ref Unsafe.AsRef(in span._reference) : ref Unsafe.AsRef<T>((void*)1);
#pragma warning restore IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

/// <summary>
/// Casts a Span of one primitive type <typeparamref name="TFrom"/> to another primitive type <typeparamref name="TTo"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Runtime.Intrinsics.X86;

#pragma warning disable 8500 // sizeof of managed types
#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

namespace System.Buffers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Runtime.Intrinsics.Wasm;
using System.Runtime.Intrinsics.X86;

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

namespace System.Buffers
{
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/System.Private.CoreLib/src/System/Span.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public Span(ref T reference)
_length = 1;
}

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228
// Constructor for internal use only. It is not safe to expose publicly, and is instead exposed via the unsafe MemoryMarshal.CreateSpan.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal Span(ref T reference, int length)
Expand All @@ -136,7 +135,6 @@ internal Span(ref T reference, int length)
_reference = ref reference;
_length = length;
}
#pragma warning restore IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

/// <summary>
/// Returns a reference to specified element of the Span.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

#pragma warning disable 8500 // sizeof of managed types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228

#pragma warning disable 8500 // sizeof of managed types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ public static unsafe void Reverse<T>(ref T elements, nuint length)
ReverseInner(ref elements, length);
}

#pragma warning disable IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void ReverseInner<T>(ref T elements, nuint length)
{
Expand All @@ -346,6 +345,5 @@ private static void ReverseInner<T>(ref T elements, nuint length)
last = ref Unsafe.Subtract(ref last, 1);
} while (Unsafe.IsAddressLessThan(ref first, ref last));
}
#pragma warning restore IDE0060 // https://github.com/dotnet/roslyn-analyzers/issues/6228
}
}

0 comments on commit 049da22

Please sign in to comment.