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

RequiresUnreferencedCode not suppressing warning from explicitly implemented generic method using lambda method #98368

Closed
eerhardt opened this issue Feb 13, 2024 · 3 comments · Fixed by #103916
Assignees
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented Feb 13, 2024

Description

When trying to annotate some Azure SDK code, I'm hitting an errant warning that shouldn't be produced. The method in question has a RequiresUnreferencedCode attribute applied to it, but there is still a trim warning sneaking through (in both PublishTrimmed and PublishAot apps).

The original code is here: https://github.com/Azure/azure-sdk-for-net/blob/a3a24ef9cd1af7ad7ef21a82a51426bb72ba59d3/sdk/extensions/Microsoft.Extensions.Azure/src/AzureClientFactoryBuilder.cs#L33-L38.

Azure/azure-sdk-for-net#41936 is opened to annotate this code for trimming/AOT, where I ran into this issue.

I've extracted what I think is a minimal repro using this code below.

Reproduction Steps

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <!--either setting will produce the errant warning-->  
    <!--<PublishAot>true</PublishAot>-->
    <PublishTrimmed>true</PublishTrimmed>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
  </ItemGroup>
</Project>
using Microsoft.Extensions.Configuration;
using System.Diagnostics.CodeAnalysis;

((IAzureClientFactoryBuilderWithConfiguration<IConfiguration>)new AzureClientFactoryBuilder()).RegisterClientFactory<object, object>(null!);

public interface IAzureClientBuilder<TClient, TOptions> where TOptions : class
{
}

public abstract class TokenCredential { }

public interface IAzureClientFactoryBuilderWithCredential
{
    IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<TClient, TOptions>(Func<TOptions, TokenCredential, TClient> clientFactory, bool requiresCredential = true) where TOptions : class;
}

public interface IAzureClientFactoryBuilderWithConfiguration<in TConfiguration>
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    [RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(TConfiguration configuration) where TOptions : class;
}

class AzureClientFactoryBuilder : IAzureClientFactoryBuilderWithConfiguration<IConfiguration>, IAzureClientFactoryBuilderWithCredential
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    [RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    IAzureClientBuilder<TClient, TOptions> IAzureClientFactoryBuilderWithConfiguration<IConfiguration>.RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(
        IConfiguration configuration)
    {
        var clientBuilder = ((IAzureClientFactoryBuilderWithCredential)this).RegisterClientFactory<TClient, TOptions>(
            (options, credentials) => (TClient)ClientFactory.CreateClient(typeof(TClient), typeof(TOptions), options, configuration, credentials));

        return clientBuilder;
    }

    // NOTE: commenting out the above explicitly implemented method, and uncommenting the below method, will make the warning go away

    //[RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    //[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    //public IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(IConfiguration configuration) where TOptions : class
    //{
    //    var clientBuilder = ((IAzureClientFactoryBuilderWithCredential)this).RegisterClientFactory<TClient, TOptions>(
    //        (options, credentials) => (TClient)ClientFactory.CreateClient(typeof(TClient), typeof(TOptions), options, configuration, credentials));

    //    return clientBuilder;
    //}

    public IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<TClient, TOptions>(Func<TOptions, TokenCredential, TClient> clientFactory, bool requiresCredential = true) where TOptions : class
    {
        throw new NotImplementedException();
    }
}

internal static class ClientFactory
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    public static object CreateClient(
        [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type clientType,
        Type optionsType,
        object options,
        IConfiguration configuration,
        TokenCredential credential)
    {
        throw new NotImplementedException();
    }
}

Expected behavior

The only trim/AOT warnings emitted should be coming from line 4 - the only caller of an incompatible method that doesn't have a RequiresUnreferencedCode attribute.

Actual behavior

Getting a warning on line 4, as expected.

But also getting a warning on line 32, which shouldn't be emitted since the method has RequiresUnreferencedCode on it:

C:\Users\eerhardt\source\repos\ConsoleApp111\ConsoleApp111\Program.cs(32,39): Trim analysis warning IL2026: AzureClientFactoryBuilder.<>c__DisplayClass0_0<TClient,TOptions>.<IAzure
ClientFactoryBuilderWithConfiguration<Microsoft.Extensions.Configuration.IConfiguration>.RegisterClientFactory>b__0(AzureClientFactoryBuilder.<>c__DisplayClass0_0<TClient,TOptions>
.TOptions, TokenCredential): Using member 'ClientFactory.CreateClient(Type, Type, Object, IConfiguration, TokenCredential)' which has 'RequiresUnreferencedCodeAttribute' can break
functionality when trimming application code. Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (
EnableConfigurationBindingGenerator=true) instead. [C:\Users\eerhardt\source\repos\ConsoleApp111\ConsoleApp111\ConsoleApp111.csproj]

Regression?

I see this both in net7.0 and net8.0. So I don't believe it is a regression.

Known Workarounds

No response

Configuration

No response

Other information

cc @sbomer @agocke @MichalStrehovsky @jtschuster

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 13, 2024
@ghost
Copy link

ghost commented Feb 13, 2024

Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

When trying to annotate some Azure SDK code, I'm hitting an errant warning that shouldn't be produced. The method in question has a RequiresUnreferencedCode attribute applied to it, but there is still a trim warning sneaking through (in both PublishTrimmed and PublishAot apps).

The original code is here: https://github.com/Azure/azure-sdk-for-net/blob/a3a24ef9cd1af7ad7ef21a82a51426bb72ba59d3/sdk/extensions/Microsoft.Extensions.Azure/src/AzureClientFactoryBuilder.cs#L33-L38

I've extracted what I think is a minimal repro using this code below.

Reproduction Steps

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <!--either setting will produce the errant warning-->  
    <!--<PublishAot>true</PublishAot>-->
    <PublishTrimmed>true</PublishTrimmed>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
  </ItemGroup>
</Project>
using Microsoft.Extensions.Configuration;
using System.Diagnostics.CodeAnalysis;

((IAzureClientFactoryBuilderWithConfiguration<IConfiguration>)new AzureClientFactoryBuilder()).RegisterClientFactory<object, object>(null!);

public interface IAzureClientBuilder<TClient, TOptions> where TOptions : class
{
}

public abstract class TokenCredential { }

public interface IAzureClientFactoryBuilderWithCredential
{
    IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<TClient, TOptions>(Func<TOptions, TokenCredential, TClient> clientFactory, bool requiresCredential = true) where TOptions : class;
}

public interface IAzureClientFactoryBuilderWithConfiguration<in TConfiguration>
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    [RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(TConfiguration configuration) where TOptions : class;
}

class AzureClientFactoryBuilder : IAzureClientFactoryBuilderWithConfiguration<IConfiguration>, IAzureClientFactoryBuilderWithCredential
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    [RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    IAzureClientBuilder<TClient, TOptions> IAzureClientFactoryBuilderWithConfiguration<IConfiguration>.RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(
        IConfiguration configuration)
    {
        var clientBuilder = ((IAzureClientFactoryBuilderWithCredential)this).RegisterClientFactory<TClient, TOptions>(
            (options, credentials) => (TClient)ClientFactory.CreateClient(typeof(TClient), typeof(TOptions), options, configuration, credentials));

        return clientBuilder;
    }

    // NOTE: commenting out the above explicitly implemented method, and uncommenting the below method, will make the warning go away

    //[RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    //[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    //public IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(IConfiguration configuration) where TOptions : class
    //{
    //    var clientBuilder = ((IAzureClientFactoryBuilderWithCredential)this).RegisterClientFactory<TClient, TOptions>(
    //        (options, credentials) => (TClient)ClientFactory.CreateClient(typeof(TClient), typeof(TOptions), options, configuration, credentials));

    //    return clientBuilder;
    //}

    public IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<TClient, TOptions>(Func<TOptions, TokenCredential, TClient> clientFactory, bool requiresCredential = true) where TOptions : class
    {
        throw new NotImplementedException();
    }
}

internal static class ClientFactory
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    public static object CreateClient(
        [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type clientType,
        Type optionsType,
        object options,
        IConfiguration configuration,
        TokenCredential credential)
    {
        throw new NotImplementedException();
    }
}

Expected behavior

The only trim/AOT warnings emitted should be coming from line 4 - the only caller of an incompatible method that doesn't have a RequiresUnreferencedCode attribute.

Actual behavior

Getting a warning on line 4, as expected.

But also getting a warning on line 32, which shouldn't be emitted since the method has RequiresUnreferencedCode on it:

C:\Users\eerhardt\source\repos\ConsoleApp111\ConsoleApp111\Program.cs(32,39): Trim analysis warning IL2026: AzureClientFactoryBuilder.<>c__DisplayClass0_0<TClient,TOptions>.<IAzure
ClientFactoryBuilderWithConfiguration<Microsoft.Extensions.Configuration.IConfiguration>.RegisterClientFactory>b__0(AzureClientFactoryBuilder.<>c__DisplayClass0_0<TClient,TOptions>
.TOptions, TokenCredential): Using member 'ClientFactory.CreateClient(Type, Type, Object, IConfiguration, TokenCredential)' which has 'RequiresUnreferencedCodeAttribute' can break
functionality when trimming application code. Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (
EnableConfigurationBindingGenerator=true) instead. [C:\Users\eerhardt\source\repos\ConsoleApp111\ConsoleApp111\ConsoleApp111.csproj]

Regression?

I see this both in net7.0 and net8.0. So I don't believe it is a regression.

Known Workarounds

No response

Configuration

No response

Other information

cc @sbomer @agocke @MichalStrehovsky @jtschuster

Author: eerhardt
Assignees: -
Labels:

untriaged, area-Extensions-Configuration

Milestone: -

@eerhardt eerhardt added area-Tools-ILLink .NET linker development as well as trimming analyzers and removed area-Extensions-Configuration labels Feb 13, 2024
@ghost
Copy link

ghost commented Feb 13, 2024

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

When trying to annotate some Azure SDK code, I'm hitting an errant warning that shouldn't be produced. The method in question has a RequiresUnreferencedCode attribute applied to it, but there is still a trim warning sneaking through (in both PublishTrimmed and PublishAot apps).

The original code is here: https://github.com/Azure/azure-sdk-for-net/blob/a3a24ef9cd1af7ad7ef21a82a51426bb72ba59d3/sdk/extensions/Microsoft.Extensions.Azure/src/AzureClientFactoryBuilder.cs#L33-L38

I've extracted what I think is a minimal repro using this code below.

Reproduction Steps

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <!--either setting will produce the errant warning-->  
    <!--<PublishAot>true</PublishAot>-->
    <PublishTrimmed>true</PublishTrimmed>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
  </ItemGroup>
</Project>
using Microsoft.Extensions.Configuration;
using System.Diagnostics.CodeAnalysis;

((IAzureClientFactoryBuilderWithConfiguration<IConfiguration>)new AzureClientFactoryBuilder()).RegisterClientFactory<object, object>(null!);

public interface IAzureClientBuilder<TClient, TOptions> where TOptions : class
{
}

public abstract class TokenCredential { }

public interface IAzureClientFactoryBuilderWithCredential
{
    IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<TClient, TOptions>(Func<TOptions, TokenCredential, TClient> clientFactory, bool requiresCredential = true) where TOptions : class;
}

public interface IAzureClientFactoryBuilderWithConfiguration<in TConfiguration>
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    [RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(TConfiguration configuration) where TOptions : class;
}

class AzureClientFactoryBuilder : IAzureClientFactoryBuilderWithConfiguration<IConfiguration>, IAzureClientFactoryBuilderWithCredential
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    [RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    IAzureClientBuilder<TClient, TOptions> IAzureClientFactoryBuilderWithConfiguration<IConfiguration>.RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(
        IConfiguration configuration)
    {
        var clientBuilder = ((IAzureClientFactoryBuilderWithCredential)this).RegisterClientFactory<TClient, TOptions>(
            (options, credentials) => (TClient)ClientFactory.CreateClient(typeof(TClient), typeof(TOptions), options, configuration, credentials));

        return clientBuilder;
    }

    // NOTE: commenting out the above explicitly implemented method, and uncommenting the below method, will make the warning go away

    //[RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    //[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    //public IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TOptions>(IConfiguration configuration) where TOptions : class
    //{
    //    var clientBuilder = ((IAzureClientFactoryBuilderWithCredential)this).RegisterClientFactory<TClient, TOptions>(
    //        (options, credentials) => (TClient)ClientFactory.CreateClient(typeof(TClient), typeof(TOptions), options, configuration, credentials));

    //    return clientBuilder;
    //}

    public IAzureClientBuilder<TClient, TOptions> RegisterClientFactory<TClient, TOptions>(Func<TOptions, TokenCredential, TClient> clientFactory, bool requiresCredential = true) where TOptions : class
    {
        throw new NotImplementedException();
    }
}

internal static class ClientFactory
{
    [RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
    public static object CreateClient(
        [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type clientType,
        Type optionsType,
        object options,
        IConfiguration configuration,
        TokenCredential credential)
    {
        throw new NotImplementedException();
    }
}

Expected behavior

The only trim/AOT warnings emitted should be coming from line 4 - the only caller of an incompatible method that doesn't have a RequiresUnreferencedCode attribute.

Actual behavior

Getting a warning on line 4, as expected.

But also getting a warning on line 32, which shouldn't be emitted since the method has RequiresUnreferencedCode on it:

C:\Users\eerhardt\source\repos\ConsoleApp111\ConsoleApp111\Program.cs(32,39): Trim analysis warning IL2026: AzureClientFactoryBuilder.<>c__DisplayClass0_0<TClient,TOptions>.<IAzure
ClientFactoryBuilderWithConfiguration<Microsoft.Extensions.Configuration.IConfiguration>.RegisterClientFactory>b__0(AzureClientFactoryBuilder.<>c__DisplayClass0_0<TClient,TOptions>
.TOptions, TokenCredential): Using member 'ClientFactory.CreateClient(Type, Type, Object, IConfiguration, TokenCredential)' which has 'RequiresUnreferencedCodeAttribute' can break
functionality when trimming application code. Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (
EnableConfigurationBindingGenerator=true) instead. [C:\Users\eerhardt\source\repos\ConsoleApp111\ConsoleApp111\ConsoleApp111.csproj]

Regression?

I see this both in net7.0 and net8.0. So I don't believe it is a regression.

Known Workarounds

No response

Configuration

No response

Other information

cc @sbomer @agocke @MichalStrehovsky @jtschuster

Author: eerhardt
Assignees: -
Labels:

untriaged, area-Tools-ILLink

Milestone: -

@sbomer sbomer added this to the 9.0.0 milestone Apr 25, 2024
@sbomer sbomer removed the untriaged New issue has not been triaged by the area owner label Apr 25, 2024
@sbomer sbomer moved this to High Priority in AppModel Jun 7, 2024
@sbomer sbomer self-assigned this Jun 7, 2024
@sbomer
Copy link
Member

sbomer commented Jun 24, 2024

Minimal repro:

using System.Diagnostics.CodeAnalysis;

((IG<object>)new C()).M();

interface IG<T> {
    [RequiresUnreferencedCode("IG.M")]
    void M();
}

class C : IG<object>
{
    [RequiresUnreferencedCode("IG<object>.M")]
    void IG<object>.M() {
        var f = () => RUC();
    }

    [RequiresUnreferencedCode("RUC")]
    static void RUC() => throw null;
}

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Jun 24, 2024
@sbomer sbomer closed this as completed in 3ec7632 Jun 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers in-pr There is an active PR which will close this issue when it is merged
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants