Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 732 Bytes

getting-diagnostics.md

File metadata and controls

18 lines (13 loc) · 732 Bytes

Example: Getting diagnostic through rustc_interface

The rustc_interface allows you to intercept diagnostics that would otherwise be printed to stderr.

Getting diagnostics

To get diagnostics from the compiler, configure rustc_interface::Config to output diagnostic to a buffer, and run TyCtxt.analysis.

{{#include ../../examples/rustc-interface-getting-diagnostics.rs}}