Skip to main content

Module analysis

Module analysis 

Source
Expand description

Borrow analysis results — the single source of truth.

BorrowAnalysis is the shared result struct consumed by:

  • The compiler (codegen decisions: move vs clone)
  • The LSP (inlay hints, borrow windows, hover info)
  • The diagnostic engine (error messages, repair suggestions)

DRY rule: Analysis runs ONCE. No consumer re-derives these results.

Structs§

BorrowAnalysis
The complete borrow analysis for a single function. Produced by the Datafrog solver + liveness analysis. Consumed (read-only) by compiler, LSP, and diagnostics.
BorrowError
A borrow conflict error with structured data for diagnostics. The diagnostic engine formats this; consumers never generate error text.
LoanInfo
Information about a single loan (borrow).
MutabilityError
Error for writing to an immutable binding.
RepairCandidate
A repair candidate (fix suggestion) verified by re-running the solver.
RepairDiff
A concrete code change for a repair suggestion.

Enums§

BorrowErrorKind
OwnershipDecision
The ownership decision for an assignment of a non-Copy type.
RepairKind