From ddcd3925b9dee247e90e2b8fefa1de8e77728620 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Fri, 30 Jul 2021 23:23:13 -0700 Subject: [PATCH 1/2] Mark HandleProcessCorruptedStateExceptionsAttribute as obsolete --- docs/project/list-of-diagnostics.md | 1 + src/libraries/Common/src/System/Obsoletions.cs | 3 +++ src/libraries/Directory.Build.targets | 3 ++- .../HandleProcessCorruptedStateExceptionsAttribute.cs | 1 + src/libraries/System.Runtime/ref/System.Runtime.cs | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index cfb593d70b54d8..5387dd5a0d7483 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -86,6 +86,7 @@ The PR that reveals the implementation of the ` - $(NoWarn);SYSLIB0003;SYSLIB0004;SYSLIB0015;SYSLIB0017;SYSLIB0021;SYSLIB0022;SYSLIB0023;SYSLIB0025 + $(NoWarn);SYSLIB0003;SYSLIB0004;SYSLIB0015;SYSLIB0017;SYSLIB0021;SYSLIB0022;SYSLIB0023;SYSLIB0025;SYSLIB0032 diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs index d77d20e85c0ef9..0fc65d64151a9b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs @@ -6,6 +6,7 @@ namespace System.Runtime.ExceptionServices // This attribute can be applied to methods to indicate that ProcessCorruptedState // Exceptions should be delivered to them. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] + [Obsolete(Obsoletions.CorruptedStateRecoveryMessage, DiagnosticId = Obsoletions.CorruptedStateRecoveryDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public sealed class HandleProcessCorruptedStateExceptionsAttribute : Attribute { public HandleProcessCorruptedStateExceptionsAttribute() diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 380e0a2e7f1009..93f41f4c996dcb 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -13234,6 +13234,7 @@ public FirstChanceExceptionEventArgs(System.Exception exception) { } public System.Exception Exception { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)] + [System.ObsoleteAttribute("Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.", DiagnosticId = "SYSLIB0032", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public sealed partial class HandleProcessCorruptedStateExceptionsAttribute : System.Attribute { public HandleProcessCorruptedStateExceptionsAttribute() { } From 4dbcd6b95a6919cf81238ea21684d54edc1e9f1f Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Fri, 30 Jul 2021 23:35:45 -0700 Subject: [PATCH 2/2] Suppress SYSLIB0032 in tests referencing HandleProcessCorruptedStateExceptionsAttribute --- .../ExceptionServices/HandleProcessCorruptedStateExceptions.cs | 2 ++ src/tests/JIT/RyuJIT/DoWhileBndChk.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptions.cs b/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptions.cs index d594b070419129..99fee3dbf5b146 100644 --- a/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptions.cs +++ b/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptions.cs @@ -10,6 +10,8 @@ using Microsoft.DotNet.RemoteExecutor; using Xunit; +#pragma warning disable SYSLIB0032 // HandleProcessCorruptedStateExceptionsAttribute is obsolete + namespace System.Runtime.ExceptionServices.Tests { public class HandleProcessCorruptedStateExceptionsTests diff --git a/src/tests/JIT/RyuJIT/DoWhileBndChk.cs b/src/tests/JIT/RyuJIT/DoWhileBndChk.cs index 68f260f06b57ee..9ba5a944f8adee 100644 --- a/src/tests/JIT/RyuJIT/DoWhileBndChk.cs +++ b/src/tests/JIT/RyuJIT/DoWhileBndChk.cs @@ -5,6 +5,8 @@ // // Reference: TF Bug 150041 +#pragma warning disable SYSLIB0032 // HandleProcessCorruptedStateExceptionsAttribute is obsolete + using System; using System.Runtime.ExceptionServices;