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

Add missing compiler-generated attributes to corelib #87857

Merged
merged 6 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
<NewtonsoftJsonBsonVersion>1.0.2</NewtonsoftJsonBsonVersion>
<SQLitePCLRawbundle_greenVersion>2.0.4</SQLitePCLRawbundle_greenVersion>
<MoqVersion>4.12.0</MoqVersion>
<MoqVersion>4.18.4</MoqVersion>
<FluentAssertionsVersion>6.7.0</FluentAssertionsVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<!-- Android gRPC client tests -->
Expand Down
2 changes: 2 additions & 0 deletions eng/testing/ILLinkDescriptors/ILLink.Descriptors.Castle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<namespace fullname="Castle.DynamicProxy" />
<type fullname="Castle.DynamicProxy.Internal.CompositionInvocation" />
<type fullname="Castle.DynamicProxy.Internal.InheritanceInvocation" />
<type fullname="Castle.DynamicProxy.Internal.InheritanceInvocationWithoutTarget" />
<type fullname="Castle.DynamicProxy.Internal.InterfaceMethodWithoutTargetInvocation" />
</assembly>
<assembly fullname="Moq">
<type fullname="Moq.Internals.InterfaceProxy">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<namespace fullname="Castle.DynamicProxy" />
<type fullname="Castle.DynamicProxy.Internal.CompositionInvocation" />
<type fullname="Castle.DynamicProxy.Internal.InheritanceInvocation" />
<type fullname="Castle.DynamicProxy.Internal.InheritanceInvocationWithoutTarget" />
<type fullname="Castle.DynamicProxy.Internal.InterfaceMethodWithoutTargetInvocation" />
</assembly>
<assembly fullname="Moq">
<type fullname="Moq.Internals.InterfaceProxy">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\InterpolatedStringHandlerAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\InterpolatedStringHandlerArgumentAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IsUnmanagedAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IteratorStateMachineAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ITuple.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\LoadHint.cs" />
Expand All @@ -821,6 +822,9 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MethodImplOptions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ModuleInitializerAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MetadataUpdateOriginalTypeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\NullableAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\NullableContextAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\NullablePublicOnlyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ReferenceAssemblyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs" />
Expand All @@ -832,6 +836,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeFeature.NonNativeAot.cs" Condition="'$(FeatureNativeAot)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeHelpers.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeWrappedException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ScopedRefAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\SkipLocalsInitAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\SpecialNameAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\StateMachineAttribute.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Struct)]
public sealed class IsByRefLikeAttribute : Attribute
{
/// <summary>Initializes the attribute.</summary>
public IsByRefLikeAttribute()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public sealed class IsReadOnlyAttribute : Attribute
{
/// <summary>Initializes the attribute.</summary>
public IsReadOnlyAttribute()
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.All)]
public sealed class IsUnmanagedAttribute : Attribute
{
/// <summary>Initializes the attribute.</summary>
public IsUnmanagedAttribute()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
public sealed class NullableAttribute : Attribute
{
/// <summary>Flags specifying metadata related to nullable reference types.</summary>
public readonly byte[] NullableFlags;

/// <summary>Initializes the attribute.</summary>
/// <param name="value">The flags value.</param>
public NullableAttribute(byte value)
{
NullableFlags = new[] { value };
}

/// <summary>Initializes the attribute.</summary>
/// <param name="value">The flags value.</param>
public NullableAttribute(byte[] value)
{
NullableFlags = value;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
public sealed class NullableContextAttribute : Attribute
{
/// <summary>Flag specifying metadata related to nullable reference types.</summary>
public readonly byte Flag;

/// <summary>Initializes the attribute.</summary>
/// <param name="value">The flag value.</param>
public NullableContextAttribute(byte value)
{
Flag = value;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Module, Inherited = false)]
public sealed class NullablePublicOnlyAttribute : Attribute
{
/// <summary>Indicates whether metadata for internal members is included.</summary>
public readonly bool IncludesInternals;

/// <summary>Initializes the attribute.</summary>
/// <param name="value">Indicates whether metadata for internal members is included.</param>
public NullablePublicOnlyAttribute(bool value)
{
IncludesInternals = value;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>Indicates the language version of the ref safety rules used when the module was compiled.</summary>
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Module, Inherited = false)]
public sealed class RefSafetyRulesAttribute : Attribute
{
/// <summary>Initializes a new instance of the <see cref="RefSafetyRulesAttribute"/> class.</summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>Specifies that a type has required members or that a member is required.</summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
public sealed class ScopedRefAttribute : Attribute
{
/// <summary>Initializes the attribute.</summary>
public ScopedRefAttribute()
{
}
}
}
43 changes: 39 additions & 4 deletions src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8283,7 +8283,7 @@ public sealed partial class ExcludeFromCodeCoverageAttribute : System.Attribute
public ExcludeFromCodeCoverageAttribute() { }
public string? Justification { get { throw null; } set { } }
}
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Module | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, Inherited = false)]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Module | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, Inherited = false)]
public sealed class ExperimentalAttribute : System.Attribute
{
public ExperimentalAttribute(string diagnosticId) { }
Expand Down Expand Up @@ -8360,7 +8360,7 @@ public RequiresUnreferencedCodeAttribute(string message) { }
public string Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsage(System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
public sealed class SetsRequiredMembersAttribute : System.Attribute
{
public SetsRequiredMembersAttribute() { }
Expand Down Expand Up @@ -12751,7 +12751,7 @@ public sealed partial class InterpolatedStringHandlerAttribute : System.Attribut
{
public InterpolatedStringHandlerAttribute() { }
}
[AttributeUsage(System.AttributeTargets.Struct, AllowMultiple = false)]
[System.AttributeUsageAttribute(System.AttributeTargets.Struct, AllowMultiple = false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class InlineArrayAttribute : System.Attribute
{
Expand Down Expand Up @@ -12781,6 +12781,11 @@ public partial interface IStrongBox
{
object? Value { get; set; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class IsUnmanagedAttribute : Attribute
{
}
public static partial class IsVolatile
{
}
Expand Down Expand Up @@ -12834,6 +12839,29 @@ public sealed partial class ModuleInitializerAttribute : System.Attribute
{
public ModuleInitializerAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Event | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue | System.AttributeTargets.GenericParameter, Inherited = false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte value) { }

public NullableAttribute(byte[] value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Method | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, Inherited = false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Module, Inherited = false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class NullablePublicOnlyAttribute : Attribute
{
public readonly bool IncludesInternals;
public NullablePublicOnlyAttribute(bool value) { }
}
public partial struct PoolingAsyncValueTaskMethodBuilder
{
private object _dummy;
Expand Down Expand Up @@ -12866,13 +12894,15 @@ public sealed partial class PreserveBaseOverridesAttribute : System.Attribute
{
public PreserveBaseOverridesAttribute() { }
}
[System.AttributeUsage(System.AttributeTargets.Module, AllowMultiple=false, Inherited=false)]
[System.AttributeUsageAttribute(System.AttributeTargets.Module, Inherited=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class RefSafetyRulesAttribute : System.Attribute
{
public RefSafetyRulesAttribute(int version) { }
public int Version { get { throw null; } }
}
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class RequiredMemberAttribute : System.Attribute
{
public RequiredMemberAttribute() { }
Expand Down Expand Up @@ -12946,6 +12976,11 @@ public RuntimeWrappedException(object thrownObject) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited = false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class ScopedRefAttribute : Attribute
{
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class SkipLocalsInitAttribute : System.Attribute
{
Expand Down
Loading
Loading