Skip to content

Commit db32911

Browse files
authored
Fix unecessary IDE0060 suppressions (#105036)
Since dotnet/roslyn#66535 `IDE0060` doesn't warn for throw-only methods.
1 parent 9e23387 commit db32911

25 files changed

+6
-52
lines changed

src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using System;
55
using System.Runtime.InteropServices;
66

7-
#pragma warning disable IDE0060
8-
97
namespace Internal.Runtime.InteropServices
108
{
119
internal static class ComActivator

src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/InMemoryAssemblyLoader.PlatformNotSupported.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5-
using System.Runtime.InteropServices;
6-
using System.Runtime.Loader;
7-
8-
#pragma warning disable IDE0060
95

106
namespace Internal.Runtime.InteropServices
117
{

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle)
2727
throw new PlatformNotSupportedException();
2828
}
2929

30-
#pragma warning disable IDE0060
3130
private static unsafe ref byte GetSpanDataFrom(
3231
RuntimeFieldHandle fldHandle,
3332
RuntimeTypeHandle targetTypeHandle,
@@ -39,7 +38,6 @@ private static unsafe ref byte GetSpanDataFrom(
3938
// https://github.com/dotnet/corert/issues/364
4039
throw new PlatformNotSupportedException();
4140
}
42-
#pragma warning disable IDE0060
4341

4442
[RequiresUnreferencedCode("Trimmer can't guarantee existence of class constructor")]
4543
public static void RunClassConstructor(RuntimeTypeHandle type)

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,10 @@ public static int GetEndComSlot(Type t)
373373
throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
374374
}
375375

376-
#pragma warning disable IDE0060
377376
internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError)
378377
{
379378
throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
380379
}
381-
#pragma warning restore
382380

383381
[SupportedOSPlatform("windows")]
384382
public static string GetTypeInfoName(ITypeInfo typeInfo)

src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ namespace System.IO
88
{
99
public static partial class Directory
1010
{
11-
#pragma warning disable IDE0060
1211
private static DirectoryInfo CreateDirectoryCore(string path, UnixFileMode unixCreateMode)
1312
=> throw new PlatformNotSupportedException(SR.PlatformNotSupported_UnixFileMode);
14-
#pragma warning restore IDE0060
1513

1614
private static unsafe string CreateTempSubdirectoryCore(string? prefix)
1715
{

src/libraries/System.Private.CoreLib/src/System/IO/File.Windows.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace System.IO
77
{
88
public static partial class File
99
{
10-
#pragma warning disable IDE0060
1110
private static UnixFileMode GetUnixFileModeCore(string path)
1211
=> throw new PlatformNotSupportedException(SR.PlatformNotSupported_UnixFileMode);
1312

@@ -19,6 +18,5 @@ private static void SetUnixFileModeCore(string path, UnixFileMode mode)
1918

2019
private static void SetUnixFileModeCore(SafeFileHandle fileHandle, UnixFileMode mode)
2120
=> throw new PlatformNotSupportedException(SR.PlatformNotSupported_UnixFileMode);
22-
#pragma warning restore IDE0060
2321
}
2422
}

src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public static void CopyFile(string sourceFullPath, string destFullPath, bool ove
6262
return null; // Let SafeFileHandle create the exception for this error.
6363
}
6464

65-
#pragma warning disable IDE0060
6665
public static void Encrypt(string path)
6766
{
6867
throw new PlatformNotSupportedException(SR.PlatformNotSupported_FileEncryption);
@@ -72,7 +71,6 @@ public static void Decrypt(string path)
7271
{
7372
throw new PlatformNotSupportedException(SR.PlatformNotSupported_FileEncryption);
7473
}
75-
#pragma warning restore IDE0060
7674

7775
private static void LinkOrCopyFile (string sourceFullPath, string destFullPath)
7876
{

src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // implementations provided as intrinsics
5-
using System;
64
using System.Diagnostics;
75
using System.Diagnostics.CodeAnalysis;
86
using System.Runtime.Versioning;

src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.PlatformNotSupported.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ public sealed partial class PosixSignalRegistration
99
{
1010
private PosixSignalRegistration() { }
1111

12-
#pragma warning disable IDE0060
1312
[DynamicDependency("#ctor")] // Prevent the private ctor and the IDisposable implementation from getting linked away
1413
private static PosixSignalRegistration Register(PosixSignal signal, Action<PosixSignalContext> handler) =>
1514
throw new PlatformNotSupportedException();
16-
#pragma warning restore IDE0060
1715

1816
partial void Unregister();
1917
}

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Aes.PlatformNotSupported.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // unused parameters
54
using System.Runtime.CompilerServices;
65

76
namespace System.Runtime.Intrinsics.Arm

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // unused parameters
54
using System.Runtime.CompilerServices;
65

76
namespace System.Runtime.Intrinsics.Arm

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // unused parameters
54
using System.Diagnostics.CodeAnalysis;
65
using System.Runtime.CompilerServices;
76

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // unused parameters
54
using System.Diagnostics.CodeAnalysis;
65
using System.Runtime.CompilerServices;
76

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha1.PlatformNotSupported.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // unused parameters
54
using System.Runtime.CompilerServices;
65

76
namespace System.Runtime.Intrinsics.Arm

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable IDE0060 // unused parameters
54
using System.Runtime.CompilerServices;
65

76
namespace System.Runtime.Intrinsics.Arm

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using System.Diagnostics.CodeAnalysis;
55
using System.Runtime.CompilerServices;
66

7-
#pragma warning disable IDE0060
8-
97
namespace System.Runtime.Intrinsics.Wasm
108
{
119
[CLSCompliant(false)]

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/WasmBase.PlatformNotSupported.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System.Runtime.CompilerServices;
5-
using System.Runtime.Intrinsics;
6-
7-
#pragma warning disable IDE0060 // Remove unused parameter
8-
94
namespace System.Runtime.Intrinsics.Wasm
105
{
116
internal abstract class WasmBase

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.PlatformNotSupported.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.CompilerServices;
65
using System.Runtime.Versioning;
76

@@ -17,8 +16,6 @@ internal X86Base() { }
1716

1817
public static bool IsSupported { [Intrinsic] get => false; }
1918

20-
#pragma warning disable IDE0060
21-
2219
public abstract class X64
2320
{
2421
internal X64() { }
@@ -119,8 +116,5 @@ internal X64() { }
119116
/// PAUSE
120117
/// </summary>
121118
public static void Pause() { throw new PlatformNotSupportedException(); }
122-
123-
#pragma warning restore IDE0060
124-
125119
}
126120
}

src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Unix.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ private void CreateEventCore(bool initialState, EventResetMode mode, string? nam
1919
createdNew = true;
2020
}
2121

22-
#pragma warning disable IDE0060
2322
private static OpenExistingResult OpenExistingWorker(string name, out EventWaitHandle? result)
2423
{
2524
throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
2625
}
27-
#pragma warning restore IDE0060
2826

2927
public bool Reset()
3028
{

src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Unix.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ private void CreateSemaphoreCore(int initialCount, int maximumCount, string? nam
2121
createdNew = true;
2222
}
2323

24-
#pragma warning disable IDE0060
2524
private static OpenExistingResult OpenExistingWorker(string name, out Semaphore? result)
2625
{
2726
throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
2827
}
29-
#pragma warning restore IDE0060
3028

3129
private int ReleaseCore(int releaseCount)
3230
{

src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,10 @@ public static bool BindHandle(IntPtr osHandle)
221221
throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle
222222
}
223223

224-
#pragma warning disable IDE0060 // Remove unused parameter
225224
[SupportedOSPlatform("windows")]
226225
public static bool BindHandle(SafeHandle osHandle)
227226
{
228227
throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle
229228
}
230-
#pragma warning restore IDE0060
231229
}
232230
}

src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.Mono.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace System.Runtime.InteropServices.ObjectiveC
99
{
1010
public static partial class ObjectiveCMarshal
1111
{
12-
#pragma warning disable IDE0060 // Remove when implemented
1312
/// <summary>
1413
/// Sets a pending exception to be thrown the next time the runtime is entered from an Objective-C msgSend P/Invoke.
1514
/// </summary>

src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using System.Runtime.Versioning;
1010
using Microsoft.Win32.SafeHandles;
1111

12-
#pragma warning disable IDE0060
13-
1412
namespace System.Threading
1513
{
1614
#if FEATURE_WASM_MANAGED_THREADS
@@ -99,10 +97,12 @@ internal static void NotifyThreadUnblocked()
9997

10098
internal static object? GetOrCreateThreadLocalCompletionCountObject() => null;
10199

100+
#pragma warning disable IDE0060
102101
internal static bool NotifyWorkItemComplete(object? threadLocalCompletionCountObject, int currentTimeMs)
103102
{
104103
return true;
105104
}
105+
#pragma warning restore IDE0060
106106

107107
private static RegisteredWaitHandle RegisterWaitForSingleObject(
108108
WaitHandle? waitObject,
@@ -166,10 +166,12 @@ public static bool BindHandle(SafeHandle osHandle)
166166
throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle
167167
}
168168

169+
#pragma warning disable IDE0060
169170
[Conditional("unnecessary")]
170171
internal static void ReportThreadStatus(bool isWorking)
171172
{
172173

173174
}
175+
#pragma warning restore IDE0060
174176
}
175177
}

src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using System.Diagnostics.CodeAnalysis;
1010
using Microsoft.Win32.SafeHandles;
1111

12-
#pragma warning disable IDE0060
13-
1412
namespace System.Threading
1513
{
1614
#if FEATURE_WASM_MANAGED_THREADS
@@ -134,10 +132,12 @@ public static bool BindHandle(SafeHandle osHandle)
134132
throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle
135133
}
136134

135+
#pragma warning disable IDE0060
137136
[Conditional("unnecessary")]
138137
internal static void ReportThreadStatus(bool isWorking)
139138
{
140139

141140
}
141+
#pragma warning restore IDE0060
142142
}
143143
}

src/mono/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Browser.Threads.Mono.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ namespace System.Threading
77
{
88
public sealed partial class ThreadPoolBoundHandle : IDisposable
99
{
10-
#pragma warning disable IDE0060
1110
private static ThreadPoolBoundHandle BindHandleCore(SafeHandle handle)
1211
{
1312
throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO);
1413
}
15-
#pragma warning restore IDE0060
1614
}
1715
}

0 commit comments

Comments
 (0)