about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples/rustc-interface-example.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/rustc-dev-guide/examples/rustc-interface-example.rs')
-rw-r--r--src/doc/rustc-dev-guide/examples/rustc-interface-example.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/rustc-dev-guide/examples/rustc-interface-example.rs b/src/doc/rustc-dev-guide/examples/rustc-interface-example.rs
index 30f48ea5297..70f27c2a82a 100644
--- a/src/doc/rustc-dev-guide/examples/rustc-interface-example.rs
+++ b/src/doc/rustc-dev-guide/examples/rustc-interface-example.rs
@@ -1,3 +1,5 @@
+// Tested with nightly-2025-02-13
+
 #![feature(rustc_private)]
 
 extern crate rustc_driver;
@@ -9,8 +11,6 @@ extern crate rustc_interface;
 extern crate rustc_session;
 extern crate rustc_span;
 
-use std::sync::Arc;
-
 use rustc_errors::registry;
 use rustc_hash::FxHashMap;
 use rustc_session::config;
@@ -56,7 +56,7 @@ fn main() {
         expanded_args: Vec::new(),
         ice_file: None,
         hash_untracked_state: None,
-        using_internal_features: Arc::default(),
+        using_internal_features: &rustc_driver::USING_INTERNAL_FEATURES,
     };
     rustc_interface::run_compiler(config, |compiler| {
         // Parse the program and print the syntax tree.
@@ -68,7 +68,7 @@ fn main() {
                 let hir = tcx.hir();
                 let item = hir.item(id);
                 match item.kind {
-                    rustc_hir::ItemKind::Static(_, _, _) | rustc_hir::ItemKind::Fn(_, _, _) => {
+                    rustc_hir::ItemKind::Static(_, _, _) | rustc_hir::ItemKind::Fn { .. } => {
                         let name = item.ident;
                         let ty = tcx.type_of(item.hir_id().owner.def_id);
                         println!("{name:?}:\t{ty:?}")