diff options
| author | Tshepang Mbambo <tshepang@gmail.com> | 2023-04-01 15:35:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-01 09:35:35 -0400 |
| commit | 09c828b18856384118e0adac5ffd22736f0aed32 (patch) | |
| tree | 84af53cd38585e67f8c1e6327284dc5aae28f700 /src/doc/rustc-dev-guide | |
| parent | 4bd5748f9f36cb6a5d1e66f68a7d8d498e24f3f2 (diff) | |
update rustc_driver examples (#1655)
Diffstat (limited to 'src/doc/rustc-dev-guide')
4 files changed, 7 insertions, 5 deletions
diff --git a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs index 9708ab01d69..70e77fd5b87 100644 --- a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs +++ b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs @@ -42,9 +42,10 @@ fn main() { "# .into(), }, - output_dir: None, // Option<PathBuf> - output_file: None, // Option<PathBuf> - file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>> + output_dir: None, // Option<PathBuf> + output_file: None, // Option<PathBuf> + file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>> + locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES, lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level> // This is a callback from the driver that is called when [`ParseSess`] is created. parse_sess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>> diff --git a/src/doc/rustc-dev-guide/examples/rustc-driver-getting-diagnostics.rs b/src/doc/rustc-dev-guide/examples/rustc-driver-getting-diagnostics.rs index 5bc2312a247..888674aaffd 100644 --- a/src/doc/rustc-dev-guide/examples/rustc-driver-getting-diagnostics.rs +++ b/src/doc/rustc-dev-guide/examples/rustc-driver-getting-diagnostics.rs @@ -66,6 +66,7 @@ fn main() { output_dir: None, output_file: None, file_loader: None, + locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES, lint_caps: rustc_hash::FxHashMap::default(), parse_sess_created: None, register_lints: None, diff --git a/src/doc/rustc-dev-guide/src/rustc-driver-getting-diagnostics.md b/src/doc/rustc-dev-guide/src/rustc-driver-getting-diagnostics.md index 3c2102a50b4..47b9fb5d902 100644 --- a/src/doc/rustc-dev-guide/src/rustc-driver-getting-diagnostics.md +++ b/src/doc/rustc-dev-guide/src/rustc-driver-getting-diagnostics.md @@ -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: Feb 2023 --> `nightly-2023-02-13`: +with <!-- date-check: mar 2023 --> `nightly-2023-03-27`: ```rust {{#include ../examples/rustc-driver-getting-diagnostics.rs}} diff --git a/src/doc/rustc-dev-guide/src/rustc-driver-interacting-with-the-ast.md b/src/doc/rustc-dev-guide/src/rustc-driver-interacting-with-the-ast.md index d058a583845..4edbbca007f 100644 --- a/src/doc/rustc-dev-guide/src/rustc-driver-interacting-with-the-ast.md +++ b/src/doc/rustc-dev-guide/src/rustc-driver-interacting-with-the-ast.md @@ -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: Feb 2023 --> `nightly-2023-02-13`: +The following was tested with <!-- date-check: mar 2023 --> `nightly-2023-03-27`: ```rust {{#include ../examples/rustc-driver-interacting-with-the-ast.rs}} |
