File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Example: Getting diagnostic through ` rustc_interface `
2
2
3
- ` rustc_interface ` allows you to intercept diagnostics that would otherwise be printed to stderr.
3
+ The [ ` rustc_interface ` ] allows you to intercept diagnostics that would
4
+ otherwise be printed to stderr.
4
5
5
6
## Getting diagnostics
6
7
7
8
To get diagnostics from the compiler,
8
- configure ` rustc_interface::Config ` to output diagnostic to a buffer,
9
- and run ` TyCtxt.analysis ` . The following was tested
9
+ configure [ ` rustc_interface::Config ` ] to output diagnostic to a buffer,
10
+ and run [ ` TyCtxt.analysis ` ] . The following was tested
10
11
with <!-- date-check: jan 2024 --> ` nightly-2024-01-19 ` :
11
12
12
13
``` rust
13
14
{{#include .. / examples / rustc - driver - getting - diagnostics . rs}}
14
15
```
16
+
17
+ [ `rustc_interface` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html
18
+ [ `rustc_interface::Config` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Config.html
19
+ [ `TyCtxt.analysis` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/passes/fn.analysis.html
You can’t perform that action at this time.
0 commit comments