Ferrous API Reference

All Types / Ferrous.Ownership

class BorrowAnalyzer

public sealed class BorrowAnalyzer : DiagnosticAnalyzer

Roslyn diagnostic analyzer enforcing Rust-inspired borrowing exclusivity (FE0202) and lexical borrow escape prevention (FE0203) for [Borrow], [BorrowMut], and ref/in parameters.

Constants

public const string ConflictingBorrowDiagnosticId = "FE0202"

Diagnostic ID reported when the same variable is simultaneously borrowed mutably and mutably/immutably in a single invocation (aliasing-XOR-mutability violation).

public const string BorrowEscapeDiagnosticId = "FE0203"

Diagnostic ID reported when a [Borrow] or [BorrowMut] parameter escapes its lexical scope (returned, stored in a field/property, or captured by a closure).

Properties

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics

Methods

public override void Initialize(AnalysisContext context)