Skip to content

Commit 29829ba

Browse files
committed
Fix unecessary IDE0060 suppressions
Since dotnet/roslyn#66535 `IDE0060` doesn't warn for throw-only methods.
1 parent 513b503 commit 29829ba

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

0 commit comments

Comments
 (0)