1- // Tested with nightly-2025-03-08
1+ // Tested with nightly-2025-03-28
22
33#![ feature( rustc_private) ]
44
@@ -20,7 +20,7 @@ use std::path::Path;
2020use std:: sync:: Arc ;
2121
2222use rustc_ast_pretty:: pprust:: item_to_string;
23- use rustc_driver:: { Compilation , run_compiler } ;
23+ use rustc_driver:: { run_compiler , Compilation } ;
2424use rustc_interface:: interface:: { Compiler , Config } ;
2525use rustc_middle:: ty:: TyCtxt ;
2626
@@ -71,13 +71,12 @@ impl rustc_driver::Callbacks for MyCallbacks {
7171
7272 fn after_analysis ( & mut self , _compiler : & Compiler , tcx : TyCtxt < ' _ > ) -> Compilation {
7373 // Analyze the program and inspect the types of definitions.
74- for id in tcx. hir_free_items ( ) {
74+ for id in tcx. hir_free_items ( ) {
7575 let item = & tcx. hir_item ( id) ;
7676 match item. kind {
77- rustc_hir:: ItemKind :: Static ( _, _, _) | rustc_hir:: ItemKind :: Fn { .. } => {
78- let name = item. ident ;
77+ rustc_hir:: ItemKind :: Static ( ident, ..) | rustc_hir:: ItemKind :: Fn { ident, .. } => {
7978 let ty = tcx. type_of ( item. hir_id ( ) . owner . def_id ) ;
80- println ! ( "{name :?}:\t {ty:?}" )
79+ println ! ( "{ident :?}:\t {ty:?}" )
8180 }
8281 _ => ( ) ,
8382 }
0 commit comments