about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs
diff options
context:
space:
mode:
authorShoyu Vanilla <modulo641@gmail.com>2024-01-21 22:26:41 +0900
committerGitHub <noreply@github.com>2024-01-21 22:26:41 +0900
commit20a0cb476254d8ba36c588cf2176293882c3fc03 (patch)
tree2b48823a4300698b00c06302f2d6e7c949503037 /src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs
parent9c5e8cc302131918bbde3b4a8864770fdf55511e (diff)
downloadrust-20a0cb476254d8ba36c588cf2176293882c3fc03.tar.gz
rust-20a0cb476254d8ba36c588cf2176293882c3fc03.zip
Update examples (#1856)
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
Diffstat (limited to 'src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs')
-rw-r--r--src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs b/src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs
index 3d3827e5dfa..104a7a7de70 100644
--- a/src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs
+++ b/src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs
@@ -10,12 +10,11 @@ extern crate rustc_interface;
 extern crate rustc_session;
 extern crate rustc_span;
 
-use std::{path, process, str};
+use std::{path, process, str, sync::Arc};
 
 use rustc_ast_pretty::pprust::item_to_string;
 use rustc_errors::registry;
-use rustc_session::config::{self, CheckCfg};
-use rustc_span::source_map;
+use rustc_session::config;
 
 fn main() {
     let out = process::Command::new("rustc")
@@ -30,7 +29,7 @@ fn main() {
             ..config::Options::default()
         },
         input: config::Input::Str {
-            name: source_map::FileName::Custom("main.rs".to_string()),
+            name: rustc_span::FileName::Custom("main.rs".to_string()),
             input: r#"
 fn main() {
     let message = "Hello, World!";
@@ -39,8 +38,8 @@ fn main() {
 "#
             .to_string(),
         },
-        crate_cfg: rustc_hash::FxHashSet::default(),
-        crate_check_cfg: CheckCfg::default(),
+        crate_cfg: Vec::new(),
+        crate_check_cfg: Vec::new(),
         output_dir: None,
         output_file: None,
         file_loader: None,
@@ -50,9 +49,11 @@ fn main() {
         register_lints: None,
         override_queries: None,
         make_codegen_backend: None,
-        registry: registry::Registry::new(&rustc_error_codes::DIAGNOSTICS),
+        registry: registry::Registry::new(rustc_error_codes::DIAGNOSTICS),
         expanded_args: Vec::new(),
         ice_file: None,
+        hash_untracked_state: None,
+        using_internal_features: Arc::default(),
     };
     rustc_interface::run_compiler(config, |compiler| {
         compiler.enter(|queries| {