Skip to content

Commit b7e20c4

Browse files
authored
update rustc_driver examples (rust-lang#1803)
1 parent 3735857 commit b7e20c4

5 files changed

+8
-2
lines changed

examples/rustc-driver-example.rs

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ fn main() {
6363
// Registry of diagnostics codes.
6464
registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
6565
make_codegen_backend: None,
66+
expanded_args: Vec::new(),
67+
ice_file: None,
6668
};
6769
rustc_interface::run_compiler(config, |compiler| {
6870
compiler.enter(|queries| {

examples/rustc-driver-getting-diagnostics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ fn main() {
7373
override_queries: None,
7474
registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
7575
make_codegen_backend: None,
76+
expanded_args: Vec::new(),
77+
ice_file: None,
7678
};
7779
rustc_interface::run_compiler(config, |compiler| {
7880
compiler.enter(|queries| {

examples/rustc-driver-interacting-with-the-ast.rs

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ fn main() {
5151
override_queries: None,
5252
make_codegen_backend: None,
5353
registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
54+
expanded_args: Vec::new(),
55+
ice_file: None,
5456
};
5557
rustc_interface::run_compiler(config, |compiler| {
5658
compiler.enter(|queries| {

src/rustc-driver-getting-diagnostics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
To get diagnostics from the compiler,
88
configure `rustc_interface::Config` to output diagnostic to a buffer,
99
and run `TyCtxt.analysis`. The following was tested
10-
with <!-- date-check: mar 2023 --> `nightly-2023-03-27`:
10+
with <!-- date-check: oct 2023 --> `nightly-2023-10-03`:
1111

1212
```rust
1313
{{#include ../examples/rustc-driver-getting-diagnostics.rs}}

src/rustc-driver-interacting-with-the-ast.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Getting the type of an expression
66

77
To get the type of an expression, use the `global_ctxt` to get a `TyCtxt`.
8-
The following was tested with <!-- date-check: mar 2023 --> `nightly-2023-03-27`:
8+
The following was tested with <!-- date-check: oct 2023 --> `nightly-2023-10-03`:
99

1010
```rust
1111
{{#include ../examples/rustc-driver-interacting-with-the-ast.rs}}

0 commit comments

Comments
 (0)