Skip to content

Commit 2bfd1b4

Browse files
authored
Cleanup CoreLib CompatibilitySuppressions (#102363)
* Cleanup CoreLib CompatibilitySuppressions * Revert ForceDictionaryLookupsAttribute change
1 parent 32d37ad commit 2bfd1b4

File tree

7 files changed

+6
-97
lines changed

7 files changed

+6
-97
lines changed

src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -837,32 +837,4 @@
837837
<DiagnosticId>CP0002</DiagnosticId>
838838
<Target>M:System.Threading.Lock.#ctor(System.Boolean)</Target>
839839
</Suppression>
840-
<Suppression>
841-
<DiagnosticId>CP0015</DiagnosticId>
842-
<Target>M:System.Diagnostics.Tracing.EventSource.Write``1(System.String,``0):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
843-
</Suppression>
844-
<Suppression>
845-
<DiagnosticId>CP0015</DiagnosticId>
846-
<Target>M:System.Diagnostics.Tracing.EventSource.Write``1(System.String,System.Diagnostics.Tracing.EventSourceOptions@,``0@):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
847-
</Suppression>
848-
<Suppression>
849-
<DiagnosticId>CP0015</DiagnosticId>
850-
<Target>M:System.Diagnostics.Tracing.EventSource.Write``1(System.String,System.Diagnostics.Tracing.EventSourceOptions@,System.Guid@,System.Guid@,``0@):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
851-
</Suppression>
852-
<Suppression>
853-
<DiagnosticId>CP0015</DiagnosticId>
854-
<Target>M:System.Diagnostics.Tracing.EventSource.WriteEvent(System.Int32,System.Object[]):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
855-
</Suppression>
856-
<Suppression>
857-
<DiagnosticId>CP0015</DiagnosticId>
858-
<Target>M:System.Diagnostics.Tracing.EventSource.WriteEventCore(System.Int32,System.Int32,System.Diagnostics.Tracing.EventSource.EventData*):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
859-
</Suppression>
860-
<Suppression>
861-
<DiagnosticId>CP0015</DiagnosticId>
862-
<Target>M:System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityId(System.Int32,System.Guid,System.Object[]):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
863-
</Suppression>
864-
<Suppression>
865-
<DiagnosticId>CP0015</DiagnosticId>
866-
<Target>M:System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore(System.Int32,System.Guid*,System.Int32,System.Diagnostics.Tracing.EventSource.EventData*):[T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute]</Target>
867-
</Suppression>
868840
</Suppressions>

src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
44
</PropertyGroup>
55

6+
<ItemGroup>
7+
<ApiCompatSuppressionFile Include="$(MSBuildProjectDirectory)\CompatibilitySuppressions.xml" />
8+
</ItemGroup>
9+
610
<ItemGroup>
711
<ILLinkSubstitutionsXmls Include="ILLink\ILLink.Substitutions.xml" />
812
<ILLinkLinkAttributesXmls Include="ILLink\ILLink.LinkAttributes.xml" />

src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<DefineConstants Condition="'$(TargetsHaiku)' == 'true'">$(DefineConstants);TARGET_HAIKU</DefineConstants>
4949
</PropertyGroup>
5050
<ItemGroup>
51-
<ApiCompatSuppressionFile Include="$(MSBuildProjectDirectory)\CompatibilitySuppressions.xml" />
5251
<ApiCompatSuppressionFile Include="$(MSBuildThisFileDirectory)CompatibilitySuppressions.xml" />
5352
</ItemGroup>
5453
<ItemGroup>

src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public partial class EventSource
1919
{
2020
private byte[]? m_providerMetadata;
2121
private protected virtual ReadOnlySpan<byte> ProviderMetadata => m_providerMetadata;
22-
private const string EventSourceRequiresUnreferenceMessage = "EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed.";
22+
private const string EventSourceRequiresUnreferenceMessage = "EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type";
2323
private const string EventSourceSuppressMessage = "Parameters to this method are primitive and are trimmer safe";
2424

2525
#if FEATURE_PERFTRACING

src/mono/System.Private.CoreLib/CompatibilitySuppressions.xml

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ internal static int TryGetHashCode(object? o)
7777
}
7878

7979
[MethodImplAttribute(MethodImplOptions.InternalCall)]
80+
[return: NotNullIfNotNull(nameof(obj))]
8081
public static extern object? GetObjectValue(object? obj);
8182

8283
[RequiresUnreferencedCode("Trimmer can't guarantee existence of class constructor")]

0 commit comments

Comments
 (0)