From 29829ba669d9f5f953729456aa33321000d1fb86 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:49:52 +0100 Subject: [PATCH] Fix unecessary `IDE0060` suppressions Since https://github.com/dotnet/roslyn/pull/66535 `IDE0060` doesn't warn for throw-only methods. --- .../InteropServices/ComActivator.PlatformNotSupported.cs | 2 -- .../InMemoryAssemblyLoader.PlatformNotSupported.cs | 4 ---- .../Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs | 2 -- .../src/System/Runtime/InteropServices/Marshal.Com.cs | 2 -- .../src/System/IO/Directory.Windows.cs | 2 -- .../System.Private.CoreLib/src/System/IO/File.Windows.cs | 2 -- .../System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs | 2 -- .../src/System/Runtime/CompilerServices/Unsafe.cs | 2 -- .../PosixSignalRegistration.PlatformNotSupported.cs | 2 -- .../Runtime/Intrinsics/Arm/Aes.PlatformNotSupported.cs | 1 - .../Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs | 1 - .../Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs | 1 - .../Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs | 1 - .../Runtime/Intrinsics/Arm/Sha1.PlatformNotSupported.cs | 1 - .../Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs | 1 - .../Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs | 2 -- .../Intrinsics/Wasm/WasmBase.PlatformNotSupported.cs | 5 ----- .../Runtime/Intrinsics/X86/X86Base.PlatformNotSupported.cs | 6 ------ .../src/System/Threading/EventWaitHandle.Unix.cs | 2 -- .../src/System/Threading/Semaphore.Unix.cs | 2 -- .../src/System/Threading/WindowsThreadPool.cs | 2 -- .../Runtime/InteropServices/ObjectiveCMarshal.Mono.cs | 1 - .../src/System/Threading/ThreadPool.Browser.Mono.cs | 6 ++++-- .../src/System/Threading/ThreadPool.Wasi.Mono.cs | 4 ++-- .../Threading/ThreadPoolBoundHandle.Browser.Threads.Mono.cs | 2 -- 25 files changed, 6 insertions(+), 52 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs index e634ebd6d47e55..bb8036686d83e6 100644 --- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs +++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs @@ -4,8 +4,6 @@ using System; using System.Runtime.InteropServices; -#pragma warning disable IDE0060 - namespace Internal.Runtime.InteropServices { internal static class ComActivator diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/InMemoryAssemblyLoader.PlatformNotSupported.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/InMemoryAssemblyLoader.PlatformNotSupported.cs index 4d944f40a36382..4e49a43a63fafe 100644 --- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/InMemoryAssemblyLoader.PlatformNotSupported.cs +++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/InMemoryAssemblyLoader.PlatformNotSupported.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Runtime.InteropServices; -using System.Runtime.Loader; - -#pragma warning disable IDE0060 namespace Internal.Runtime.InteropServices { diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs index 532da20332ab3d..8da99ebcef655b 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs @@ -27,7 +27,6 @@ public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle) throw new PlatformNotSupportedException(); } -#pragma warning disable IDE0060 private static unsafe ref byte GetSpanDataFrom( RuntimeFieldHandle fldHandle, RuntimeTypeHandle targetTypeHandle, @@ -39,7 +38,6 @@ private static unsafe ref byte GetSpanDataFrom( // https://github.com/dotnet/corert/issues/364 throw new PlatformNotSupportedException(); } -#pragma warning disable IDE0060 [RequiresUnreferencedCode("Trimmer can't guarantee existence of class constructor")] public static void RunClassConstructor(RuntimeTypeHandle type) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs index c52ff95890bf90..57bab379b3a02c 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs @@ -373,12 +373,10 @@ public static int GetEndComSlot(Type t) throw new NotSupportedException(SR.PlatformNotSupported_ComInterop); } -#pragma warning disable IDE0060 internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) { throw new NotSupportedException(SR.PlatformNotSupported_ComInterop); } -#pragma warning restore [SupportedOSPlatform("windows")] public static string GetTypeInfoName(ITypeInfo typeInfo) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.cs index 3553186a6dd47e..f0fdfceeab1953 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.cs @@ -8,10 +8,8 @@ namespace System.IO { public static partial class Directory { -#pragma warning disable IDE0060 private static DirectoryInfo CreateDirectoryCore(string path, UnixFileMode unixCreateMode) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_UnixFileMode); -#pragma warning restore IDE0060 private static unsafe string CreateTempSubdirectoryCore(string? prefix) { diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/File.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/File.Windows.cs index cb846a5d7ba33f..70ee2e2c142c52 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/File.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/File.Windows.cs @@ -7,7 +7,6 @@ namespace System.IO { public static partial class File { -#pragma warning disable IDE0060 private static UnixFileMode GetUnixFileModeCore(string path) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_UnixFileMode); @@ -19,6 +18,5 @@ private static void SetUnixFileModeCore(string path, UnixFileMode mode) private static void SetUnixFileModeCore(SafeFileHandle fileHandle, UnixFileMode mode) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_UnixFileMode); -#pragma warning restore IDE0060 } } diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs index be6505d9bd93f6..69ed0a6016adcf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs @@ -62,7 +62,6 @@ public static void CopyFile(string sourceFullPath, string destFullPath, bool ove return null; // Let SafeFileHandle create the exception for this error. } -#pragma warning disable IDE0060 public static void Encrypt(string path) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_FileEncryption); @@ -72,7 +71,6 @@ public static void Decrypt(string path) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_FileEncryption); } -#pragma warning restore IDE0060 private static void LinkOrCopyFile (string sourceFullPath, string destFullPath) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs index a19092f4a4328d..1664dd02e0e5fa 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // implementations provided as intrinsics -using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.Versioning; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.PlatformNotSupported.cs index ae6781b2b552ed..9db94c31ba2421 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.PlatformNotSupported.cs @@ -9,11 +9,9 @@ public sealed partial class PosixSignalRegistration { private PosixSignalRegistration() { } -#pragma warning disable IDE0060 [DynamicDependency("#ctor")] // Prevent the private ctor and the IDisposable implementation from getting linked away private static PosixSignalRegistration Register(PosixSignal signal, Action handler) => throw new PlatformNotSupportedException(); -#pragma warning restore IDE0060 partial void Unregister(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Aes.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Aes.PlatformNotSupported.cs index a36723a66fdee6..d7117540d40afe 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Aes.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Aes.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // unused parameters using System.Runtime.CompilerServices; namespace System.Runtime.Intrinsics.Arm diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs index aab444638fda17..faafd1bb5f491b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // unused parameters using System.Runtime.CompilerServices; namespace System.Runtime.Intrinsics.Arm diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs index 5f1adc320d7b73..d45ffb73266dce 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // unused parameters using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs index 9fa363b883fa7e..4d021f3f5885e3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // unused parameters using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha1.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha1.PlatformNotSupported.cs index 8dad58c7a992ea..d56d7173ca83c0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha1.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha1.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // unused parameters using System.Runtime.CompilerServices; namespace System.Runtime.Intrinsics.Arm diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs index e4af188de770eb..1869dfb3f6d0ef 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable IDE0060 // unused parameters using System.Runtime.CompilerServices; namespace System.Runtime.Intrinsics.Arm diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs index 91bb2adef90a5b..a78f608ae7383d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs @@ -4,8 +4,6 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -#pragma warning disable IDE0060 - namespace System.Runtime.Intrinsics.Wasm { [CLSCompliant(false)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/WasmBase.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/WasmBase.PlatformNotSupported.cs index a9151a8a2802e4..e12c419b638273 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/WasmBase.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/WasmBase.PlatformNotSupported.cs @@ -1,11 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.CompilerServices; -using System.Runtime.Intrinsics; - -#pragma warning disable IDE0060 // Remove unused parameter - namespace System.Runtime.Intrinsics.Wasm { internal abstract class WasmBase diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.PlatformNotSupported.cs index 89303f0b6ffe0c..5a0f1dbeec7de1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.PlatformNotSupported.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Runtime.CompilerServices; using System.Runtime.Versioning; @@ -17,8 +16,6 @@ internal X86Base() { } public static bool IsSupported { [Intrinsic] get => false; } -#pragma warning disable IDE0060 - public abstract class X64 { internal X64() { } @@ -119,8 +116,5 @@ internal X64() { } /// PAUSE /// public static void Pause() { throw new PlatformNotSupportedException(); } - -#pragma warning restore IDE0060 - } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Unix.cs index cf87d680dd62fc..ddd99cabab41f0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Unix.cs @@ -19,12 +19,10 @@ private void CreateEventCore(bool initialState, EventResetMode mode, string? nam createdNew = true; } -#pragma warning disable IDE0060 private static OpenExistingResult OpenExistingWorker(string name, out EventWaitHandle? result) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); } -#pragma warning restore IDE0060 public bool Reset() { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Unix.cs index df219a8ca7d80c..4940acad545f5d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Unix.cs @@ -21,12 +21,10 @@ private void CreateSemaphoreCore(int initialCount, int maximumCount, string? nam createdNew = true; } -#pragma warning disable IDE0060 private static OpenExistingResult OpenExistingWorker(string name, out Semaphore? result) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); } -#pragma warning restore IDE0060 private int ReleaseCore(int releaseCount) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.cs index 6b3ae288e37afc..afd969ca4faec2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.cs @@ -221,12 +221,10 @@ public static bool BindHandle(IntPtr osHandle) throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle } -#pragma warning disable IDE0060 // Remove unused parameter [SupportedOSPlatform("windows")] public static bool BindHandle(SafeHandle osHandle) { throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle } -#pragma warning restore IDE0060 } } diff --git a/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.Mono.cs index 21ba205c5b10cf..0f4945b8e138c8 100644 --- a/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.Mono.cs @@ -9,7 +9,6 @@ namespace System.Runtime.InteropServices.ObjectiveC { public static partial class ObjectiveCMarshal { -#pragma warning disable IDE0060 // Remove when implemented /// /// Sets a pending exception to be thrown the next time the runtime is entered from an Objective-C msgSend P/Invoke. /// diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs index c707dd3506334e..dbfe5c87957fbb 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs @@ -9,8 +9,6 @@ using System.Runtime.Versioning; using Microsoft.Win32.SafeHandles; -#pragma warning disable IDE0060 - namespace System.Threading { #if FEATURE_WASM_MANAGED_THREADS @@ -99,10 +97,12 @@ internal static void NotifyThreadUnblocked() internal static object? GetOrCreateThreadLocalCompletionCountObject() => null; +#pragma warning disable IDE0060 internal static bool NotifyWorkItemComplete(object? threadLocalCompletionCountObject, int currentTimeMs) { return true; } +#pragma warning restore IDE0060 private static RegisteredWaitHandle RegisterWaitForSingleObject( WaitHandle? waitObject, @@ -166,10 +166,12 @@ public static bool BindHandle(SafeHandle osHandle) throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle } +#pragma warning disable IDE0060 [Conditional("unnecessary")] internal static void ReportThreadStatus(bool isWorking) { } +#pragma warning restore IDE0060 } } diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs index 557020c913efd3..688c1a3b05de97 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.Mono.cs @@ -9,8 +9,6 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.Win32.SafeHandles; -#pragma warning disable IDE0060 - namespace System.Threading { #if FEATURE_WASM_MANAGED_THREADS @@ -134,10 +132,12 @@ public static bool BindHandle(SafeHandle osHandle) throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle } +#pragma warning disable IDE0060 [Conditional("unnecessary")] internal static void ReportThreadStatus(bool isWorking) { } +#pragma warning restore IDE0060 } } diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Browser.Threads.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Browser.Threads.Mono.cs index 6d06335953dcab..c1bcfa75b8c2f0 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Browser.Threads.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Browser.Threads.Mono.cs @@ -7,11 +7,9 @@ namespace System.Threading { public sealed partial class ThreadPoolBoundHandle : IDisposable { -#pragma warning disable IDE0060 private static ThreadPoolBoundHandle BindHandleCore(SafeHandle handle) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); } -#pragma warning restore IDE0060 } }