diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs index 5d3790438fe564..5144ef058c2c59 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs @@ -9,7 +9,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; -using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; using System.Threading.Tasks.Sources; @@ -288,7 +287,6 @@ private static unsafe Continuation AllocContinuationClass(Continuation prevConti /// Task or a ValueTaskNotifier whose completion we are awaiting. [BypassReadyToRun] [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)] - [RequiresPreviewFeatures] private static void TransparentAwait(object o) { ref RuntimeAsyncAwaitState state = ref t_runtimeAsyncAwaitState; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs index acbe2c960f8ad0..0d5ff2b7ca8143 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Reflection; using System.Runtime.InteropServices; -using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; @@ -25,7 +24,6 @@ public static partial class AsyncHelpers /// The awaiter to await. [BypassReadyToRun] [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static void AwaitAwaiter(TAwaiter awaiter) where TAwaiter : INotifyCompletion { @@ -49,7 +47,6 @@ public static void AwaitAwaiter(TAwaiter awaiter) where TAwaiter : INo /// The awaiter to await. [BypassReadyToRun] [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static void UnsafeAwaitAwaiter(TAwaiter awaiter) where TAwaiter : ICriticalNotifyCompletion { @@ -71,7 +68,6 @@ public static void UnsafeAwaitAwaiter(TAwaiter awaiter) where TAwaiter [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static T Await(Task task) { @@ -91,7 +87,6 @@ public static T Await(Task task) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static void Await(Task task) { @@ -112,7 +107,6 @@ public static void Await(Task task) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static T Await(ValueTask task) { @@ -132,7 +126,6 @@ public static T Await(ValueTask task) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static void Await(ValueTask task) { @@ -152,7 +145,6 @@ public static void Await(ValueTask task) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static void Await(ConfiguredTaskAwaitable configuredAwaitable) { @@ -172,7 +164,6 @@ public static void Await(ConfiguredTaskAwaitable configuredAwaitable) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static void Await(ConfiguredValueTaskAwaitable configuredAwaitable) { @@ -193,7 +184,6 @@ public static void Await(ConfiguredValueTaskAwaitable configuredAwaitable) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static T Await(ConfiguredTaskAwaitable configuredAwaitable) { @@ -214,7 +204,6 @@ public static T Await(ConfiguredTaskAwaitable configuredAwaitable) [Intrinsic] [BypassReadyToRun] [MethodImpl(MethodImplOptions.Async)] - [RequiresPreviewFeatures] [StackTraceHidden] public static T Await(ConfiguredValueTaskAwaitable configuredAwaitable) { @@ -227,26 +216,16 @@ public static T Await(ConfiguredValueTaskAwaitable configuredAwaitable) return awaiter.GetResult(); } #else - [RequiresPreviewFeatures] - public static void UnsafeAwaitAwaiter(TAwaiter awaiter) where TAwaiter : ICriticalNotifyCompletion { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static void AwaitAwaiter(TAwaiter awaiter) where TAwaiter : INotifyCompletion { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static void Await(System.Threading.Tasks.Task task) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static T Await(System.Threading.Tasks.Task task) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static void Await(System.Threading.Tasks.ValueTask task) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static T Await(System.Threading.Tasks.ValueTask task) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static void Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static void Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static T Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable) { throw new NotImplementedException(); } - [RequiresPreviewFeatures] - public static T Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable) { throw new NotImplementedException(); } + public static void UnsafeAwaitAwaiter(TAwaiter awaiter) where TAwaiter : ICriticalNotifyCompletion { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static void AwaitAwaiter(TAwaiter awaiter) where TAwaiter : INotifyCompletion { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static void Await(System.Threading.Tasks.Task task) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static T Await(System.Threading.Tasks.Task task) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static void Await(System.Threading.Tasks.ValueTask task) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static T Await(System.Threading.Tasks.ValueTask task) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static void Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static void Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static T Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } + public static T Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable) { throw new PlatformNotSupportedException("Runtime Async is not supported on this platform."); } #endif } } diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index ffa9bf58bdcecf..65b98d13078b29 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -14201,25 +14201,15 @@ public static void RunModuleConstructor(System.ModuleHandle module) { } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public static partial class AsyncHelpers { - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static void UnsafeAwaitAwaiter(TAwaiter awaiter) where TAwaiter : ICriticalNotifyCompletion { } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static void AwaitAwaiter(TAwaiter awaiter) where TAwaiter : INotifyCompletion { } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static void Await(System.Threading.Tasks.Task task) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static T Await(System.Threading.Tasks.Task task) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static void Await(System.Threading.Tasks.ValueTask task) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static T Await(System.Threading.Tasks.ValueTask task) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static void Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static void Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static T Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable) { throw null; } - [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] public static T Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable) { throw null; } public static void HandleAsyncEntryPoint(System.Threading.Tasks.Task task) { } public static int HandleAsyncEntryPoint(System.Threading.Tasks.Task task) { throw null; } diff --git a/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml b/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml index 3885a47c05bd09..0b09a7a8c43b02 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml @@ -1,27 +1,69 @@ - + CP0014 - T:System.Runtime.CompilerServices.AsyncHelpers:[T:System.Diagnostics.CodeAnalysis.ExperimentalAttribute] + M:System.Runtime.CompilerServices.AsyncHelpers.Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] net10.0/System.Runtime.dll net11.0/System.Runtime.dll - CP0015 - T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] - net10.0/System.Diagnostics.Tools.dll - net11.0/System.Diagnostics.Tools.dll + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll - CP0015 - T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await(System.Threading.Tasks.Task):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] net10.0/System.Runtime.dll net11.0/System.Runtime.dll - CP0015 - T:System.Diagnostics.StackTraceHiddenAttribute:[T:System.AttributeUsageAttribute] + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await(System.Threading.Tasks.ValueTask):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await``1(System.Runtime.CompilerServices.ConfiguredTaskAwaitable{``0}):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await``1(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable{``0}):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await``1(System.Threading.Tasks.Task{``0}):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.Await``1(System.Threading.Tasks.ValueTask{``0}):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.AwaitAwaiter``1(``0):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + M:System.Runtime.CompilerServices.AsyncHelpers.UnsafeAwaitAwaiter``1(``0):[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0014 + T:System.Runtime.CompilerServices.AsyncHelpers:[T:System.Diagnostics.CodeAnalysis.ExperimentalAttribute] net10.0/System.Runtime.dll net11.0/System.Runtime.dll @@ -31,10 +73,28 @@ net10.0/netstandard.dll net11.0/netstandard.dll + + CP0015 + T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] + net10.0/System.Diagnostics.Tools.dll + net11.0/System.Diagnostics.Tools.dll + CP0015 T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] net10.0/System.dll net11.0/System.dll + + CP0015 + T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0015 + T:System.Diagnostics.StackTraceHiddenAttribute:[T:System.AttributeUsageAttribute] + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + \ No newline at end of file diff --git a/src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj b/src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj index 0744068de54384..4a015bc375e61e 100644 --- a/src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj +++ b/src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj @@ -2,7 +2,6 @@ true - $(NoWarn);SYSLIB5007 $(Features);runtime-async=on diff --git a/src/tests/async/Directory.Build.props b/src/tests/async/Directory.Build.props index f505092384b1b1..a1f7d48cf60a7d 100644 --- a/src/tests/async/Directory.Build.props +++ b/src/tests/async/Directory.Build.props @@ -5,7 +5,7 @@ true - $(NoWarn);xUnit1013;CS1998;SYSLIB5007 + $(NoWarn);xUnit1013;CS1998 false $(Features);runtime-async=on diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/RuntimeAsyncMethods.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/RuntimeAsyncMethods.cs index a73470c801c178..0befece2f931b1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/RuntimeAsyncMethods.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/RuntimeAsyncMethods.cs @@ -14,7 +14,6 @@ namespace Mono.Linker.Tests.Cases.DataFlow { [SkipKeptItemsValidation] [SetupCompileArgument("/features:runtime-async=on")] - [SetupCompileArgument("/nowarn:SYSLIB5007")] [ExpectedNoWarnings] public class RuntimeAsyncMethods {