Module diagnostics

Source
Expand description

诊断信息与错误报告核心模块。

提供统一的诊断对象接口、错误定位、分级报告与彩色格式化输出, 支持编译器前端、分析器等场景下的高质量错误与警告展示。

§主要功能

  • 诊断对象的统一 trait(Diagnostic)
  • 错误/警告分级(ReportSeverity)
  • 源码精确定位(SourceLocation)
  • 彩色人类可读报告格式化
  • 诊断信息的批量收集与报告(见 collector 子模块)

§典型用法

let diag: Box<dyn Diagnostic> = ...;
println!("{}", diag.format_report());

Modules§

collector
诊断信息收集与统一接口模块。

Structs§

SourceLocation
源码错误的精确定位信息。

Enums§

ReportSeverity
诊断信息的严重级别。

Traits§

Diagnostic
诊断对象统一 trait。