Skip to content

Commit aa2a0d1

Browse files
Tbkhitshepang
authored andcommitted
Update rustc-driver-getting-diagnostics.md
1 parent f863101 commit aa2a0d1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
+8-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# Example: Getting diagnostic through `rustc_interface`
22

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.
45

56
## Getting diagnostics
67

78
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
1011
with <!-- date-check: jan 2024 --> `nightly-2024-01-19`:
1112

1213
```rust
1314
{{#include ../examples/rustc-driver-getting-diagnostics.rs}}
1415
```
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

0 commit comments

Comments
 (0)