Expand description
Source map for the diagnostic bridge.
Maps generated Rust code back to LOGOS source positions, enabling friendly error messages for ownership/lifetime errors detected by rustc.
§Architecture
LOGOS Source CodeGen Rust Source rustc Diagnostics
│ │ │ │ │
│ SourceMap │ │ │ │
│◄─────────────┼────────────┼───────────┼───────────┤
│ line 5 │ │ line 12 │ E0382 │
│ span │ │ │ line 12 │
└──────────────┴────────────┴───────────┴───────────┘§Usage
The source map is built during code generation by calling builder methods
at each statement. The diagnostic bridge then uses
SourceMap::find_nearest_span to translate rustc line numbers.
Structs§
- Source
Map - Maps generated Rust code back to LOGOS source.
- Source
MapBuilder - Builder for constructing a SourceMap during code generation.
- VarOrigin
- Variable origin tracking for error translation.
Enums§
- Ownership
Role - Semantic role of a variable in LOGOS ownership semantics.