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§
- Borrow
Analysis - The complete borrow analysis for a single function. Produced by the Datafrog solver + liveness analysis. Consumed (read-only) by compiler, LSP, and diagnostics.
- Borrow
Error - A borrow conflict error with structured data for diagnostics. The diagnostic engine formats this; consumers never generate error text.
- Function
Borrow Summary - Summary of a function’s parameter borrow requirements. Used for interprocedural alias checking at call sites.
- Loan
Info - Information about a single loan (borrow).
- Loan
Sink - Mutability
Error - Error for writing to an immutable binding.
- Reference
Origin - A normalized origin for a first-class reference value.
- Repair
Candidate - A repair candidate (fix suggestion) verified by re-running the solver.
- Repair
Diff - A concrete code change for a repair suggestion.
- Return
Reference Summary
Enums§
- Borrow
Error Code - Stable, user-facing borrow error codes.
- Borrow
Error Kind - Loan
Sink Kind - Ownership
Decision - The ownership decision for an assignment of a non-Copy type.
- Reference
Origin Root - Repair
Kind