Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update rustc_driver examples #1803

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/rustc-driver-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ fn main() {
// Registry of diagnostics codes.
registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
make_codegen_backend: None,
expanded_args: Vec::new(),
ice_file: None,
};
rustc_interface::run_compiler(config, |compiler| {
compiler.enter(|queries| {
Expand Down
2 changes: 2 additions & 0 deletions examples/rustc-driver-getting-diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ fn main() {
override_queries: None,
registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
make_codegen_backend: None,
expanded_args: Vec::new(),
ice_file: None,
};
rustc_interface::run_compiler(config, |compiler| {
compiler.enter(|queries| {
Expand Down
2 changes: 2 additions & 0 deletions examples/rustc-driver-interacting-with-the-ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ fn main() {
override_queries: None,
make_codegen_backend: None,
registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
expanded_args: Vec::new(),
ice_file: None,
};
rustc_interface::run_compiler(config, |compiler| {
compiler.enter(|queries| {
Expand Down
2 changes: 1 addition & 1 deletion src/rustc-driver-getting-diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
To get diagnostics from the compiler,
configure `rustc_interface::Config` to output diagnostic to a buffer,
and run `TyCtxt.analysis`. The following was tested
with <!-- date-check: mar 2023 --> `nightly-2023-03-27`:
with <!-- date-check: oct 2023 --> `nightly-2023-10-03`:

```rust
{{#include ../examples/rustc-driver-getting-diagnostics.rs}}
Expand Down
2 changes: 1 addition & 1 deletion src/rustc-driver-interacting-with-the-ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Getting the type of an expression

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

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