about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples
diff options
context:
space:
mode:
authorSimon Perriard <simon.perriard@chainsecurity.com>2021-11-24 10:07:12 +0100
committerJoshua Nelson <github@jyn.dev>2021-11-24 09:00:37 -0500
commit5c79aa782faf1c7705efffcbc88120b74d940306 (patch)
tree2d0a9f86e8bd0547f072faebf6b268ad61e5283b /src/doc/rustc-dev-guide/examples
parentd199d090b6243a35f9b488d0c4a675f390c55fde (diff)
downloadrust-5c79aa782faf1c7705efffcbc88120b74d940306.tar.gz
rust-5c79aa782faf1c7705efffcbc88120b74d940306.zip
make it compile with 1.56.0
Diffstat (limited to 'src/doc/rustc-dev-guide/examples')
-rw-r--r--src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs4
1 files changed, 2 insertions, 2 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 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;