Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary pragmas #55810

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Http/Http.Results/src/ResultsOfTHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ 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.")]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod",
Justification = "The call to MakeGenericMethod is safe due to the fact that PopulateMetadata<TTarget> does not have a DynamicallyAccessMembers attribute and TTarget is annotated to preserve all methods to preserve the PopulateMetadata method.")]
static void InvokeGenericPopulateMetadata(object[] parameters)
Expand Down
2 changes: 0 additions & 2 deletions src/Http/Routing/src/Matching/JumpTableBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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;

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl x64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: macOS arm64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux x64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux ARM)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux ARM64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: macOS x64)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)

Check failure on line 4 in src/Http/Routing/src/Matching/JumpTableBuilder.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Http/Routing/src/Matching/JumpTableBuilder.cs#L4

src/Http/Routing/src/Matching/JumpTableBuilder.cs(4,1): error IDE0005: (NETCORE_ENGINEERING_TELEMETRY=Build) Using directive is unnecessary. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005)
using System.Runtime.CompilerServices;
using System.Text;

Expand Down Expand Up @@ -89,8 +89,6 @@
// 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.
Expand Down
6 changes: 0 additions & 6 deletions src/Shared/PropertyHelper/PropertyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
amcasey marked this conversation as resolved.
Show resolved Hide resolved
// 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.
Expand All @@ -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
{
Expand Down Expand Up @@ -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.
Expand All @@ -305,7 +300,6 @@ public static PropertyHelper[] GetVisibleProperties(
typeof(Action<object, object?>), propertySetterAsAction);

return (Action<object, object?>)callPropertySetterDelegate;
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
}
else
{
Expand Down
Loading