diff --git a/examples/rustc-driver-example.rs b/examples/rustc-driver-example.rs index 51af6f5a..29fa2478 100644 --- a/examples/rustc-driver-example.rs +++ b/examples/rustc-driver-example.rs @@ -73,7 +73,7 @@ fn main() { println!("{:#?}", parse); // Analyze the program and inspect the types of definitions. queries.global_ctxt().unwrap().take().enter(|tcx| { - for (_, item) in &tcx.hir().krate().items { + for item in tcx.hir().items() { match item.kind { rustc_hir::ItemKind::Static(_, _, _) | rustc_hir::ItemKind::Fn(_, _, _) => { let name = item.ident;