From 5c79aa782faf1c7705efffcbc88120b74d940306 Mon Sep 17 00:00:00 2001 From: Simon Perriard Date: Wed, 24 Nov 2021 10:07:12 +0100 Subject: make it compile with 1.56.0 --- .../rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/doc/rustc-dev-guide/examples') 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 2c753349807..cbf48c9ceba 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 @@ -64,9 +64,9 @@ fn main() { // Analyze the crate and inspect the types under the cursor. queries.global_ctxt().unwrap().take().enter(|tcx| { // Every compilation contains a single crate. - let hir_krate = tcx.hir().krate(); + let hir_krate = tcx.hir(); // Iterate over the top-level items in the crate, looking for the main function. - for (_, item) in &hir_krate.items { + for item in hir_krate.items() { // Use pattern-matching to find a specific node inside the main function. if let rustc_hir::ItemKind::Fn(_, _, body_id) = item.kind { let expr = &tcx.hir().body(body_id).value; -- cgit 1.4.1-3-g733a5