diff --git a/src/Http/Http.Results/src/ResultsOfTHelper.cs b/src/Http/Http.Results/src/ResultsOfTHelper.cs index 71eefb826714..349da0c9084a 100644 --- a/src/Http/Http.Results/src/ResultsOfTHelper.cs +++ b/src/Http/Http.Results/src/ResultsOfTHelper.cs @@ -47,8 +47,7 @@ internal static class ResultsOfTHelper } } - // TODO: Remove IL3050 suppress when https://github.com/dotnet/linker/issues/2715 is complete. - [UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Validated with IsDynamicCodeSupported check.")] + [RequiresDynamicCode("The native code for the PopulateMetadata instantiation might not be available at runtime.")] [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod", Justification = "The call to MakeGenericMethod is safe due to the fact that PopulateMetadata does not have a DynamicallyAccessMembers attribute and TTarget is annotated to preserve all methods to preserve the PopulateMetadata method.")] static void InvokeGenericPopulateMetadata(object[] parameters) diff --git a/src/Http/Routing/src/Matching/JumpTableBuilder.cs b/src/Http/Routing/src/Matching/JumpTableBuilder.cs index 5509ad659a7f..1c2dab7bb4d6 100644 --- a/src/Http/Routing/src/Matching/JumpTableBuilder.cs +++ b/src/Http/Routing/src/Matching/JumpTableBuilder.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.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; @@ -89,8 +88,6 @@ public static JumpTable Build(int defaultDestination, int exitDestination, (stri // Use the ILEmitTrieJumpTable if the IL is going to be compiled (not interpreted) return MakeILEmitTrieJumpTableIfSupported(defaultDestination, exitDestination, pathEntries, fallback); - // TODO: This suppression can be removed when https://github.com/dotnet/linker/issues/2715 is complete. - [UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Guarded by IsDynamicCodeCompiled")] static JumpTable MakeILEmitTrieJumpTableIfSupported(int defaultDestination, int exitDestination, (string text, int destination)[] pathEntries, JumpTable fallback) { // ILEmitTrieJumpTable use IL emit to generate a custom, high-performance jump table. diff --git a/src/Shared/PropertyHelper/PropertyHelper.cs b/src/Shared/PropertyHelper/PropertyHelper.cs index 20b10b4a6be5..53e16a285c9a 100644 --- a/src/Shared/PropertyHelper/PropertyHelper.cs +++ b/src/Shared/PropertyHelper/PropertyHelper.cs @@ -212,8 +212,6 @@ public static PropertyHelper[] GetVisibleProperties( // MakeGenericMethod + value type requires IsDynamicCodeSupported to be true. if (RuntimeFeature.IsDynamicCodeSupported) { - // TODO: Remove disable when https://github.com/dotnet/linker/issues/2715 is complete. -#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. // Instance methods in the CLR can be turned into static methods where the first parameter // is open over "target". This parameter is always passed by reference, so we have a code // path for value types and a code path for reference types. @@ -233,7 +231,6 @@ public static PropertyHelper[] GetVisibleProperties( getMethod, propertyGetterWrapperMethod); } -#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. } else { @@ -287,8 +284,6 @@ public static PropertyHelper[] GetVisibleProperties( // MakeGenericMethod + value type requires IsDynamicCodeSupported to be true. if (RuntimeFeature.IsDynamicCodeSupported) { - // TODO: Remove disable when https://github.com/dotnet/linker/issues/2715 is complete. -#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. // Instance methods in the CLR can be turned into static methods where the first parameter // is open over "target". This parameter is always passed by reference, so we have a code // path for value types and a code path for reference types. @@ -305,7 +300,6 @@ public static PropertyHelper[] GetVisibleProperties( typeof(Action), propertySetterAsAction); return (Action)callPropertySetterDelegate; -#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. } else {