Ferrous API Reference

All Types / Ferrous.Annotations

class MustUseAnalyzer

public sealed class MustUseAnalyzer : DiagnosticAnalyzer

Roslyn diagnostic analyzer that warns when a value annotated with [MustUse] (via its method, constructor, or return type) is discarded in an expression statement. Equivalent to Rust's #[must_use] lint.

Constants

public const string DiagnosticId = "FE0001"

Diagnostic ID reported when a [MustUse] value is ignored.

Properties

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics

Methods

public override void Initialize(AnalysisContext context)