From f28f707be4450374414d30ad1c60c5acc3e753ee Mon Sep 17 00:00:00 2001 From: Takayuki Nakata Date: Mon, 3 Aug 2020 22:02:52 +0900 Subject: [PATCH] Fix examples not working --- examples/rustc-driver-example.rs | 1 - examples/rustc-driver-getting-diagnostics.rs | 1 - examples/rustc-driver-interacting-with-the-ast.rs | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/rustc-driver-example.rs b/examples/rustc-driver-example.rs index 4b0b23aa..f01072b7 100644 --- a/examples/rustc-driver-example.rs +++ b/examples/rustc-driver-example.rs @@ -3,7 +3,6 @@ // NOTE: For the example to compile, you will need to first run the following: // rustup component add rustc-dev -extern crate rustc; extern crate rustc_error_codes; extern crate rustc_errors; extern crate rustc_hash; diff --git a/examples/rustc-driver-getting-diagnostics.rs b/examples/rustc-driver-getting-diagnostics.rs index cf08ed87..e1caab32 100644 --- a/examples/rustc-driver-getting-diagnostics.rs +++ b/examples/rustc-driver-getting-diagnostics.rs @@ -3,7 +3,6 @@ // NOTE: For the example to compile, you will need to first run the following: // rustup component add rustc-dev -extern crate rustc; extern crate rustc_error_codes; extern crate rustc_errors; extern crate rustc_hash; diff --git a/examples/rustc-driver-interacting-with-the-ast.rs b/examples/rustc-driver-interacting-with-the-ast.rs index 105ee001..e33c2ee9 100644 --- a/examples/rustc-driver-interacting-with-the-ast.rs +++ b/examples/rustc-driver-interacting-with-the-ast.rs @@ -3,7 +3,6 @@ // NOTE: For the example to compile, you will need to first run the following: // rustup component add rustc-dev -extern crate rustc; extern crate rustc_error_codes; extern crate rustc_errors; extern crate rustc_hash; @@ -65,7 +64,7 @@ fn main() { if let Some(expr) = local.init { let hir_id = expr.hir_id; // hir_id identifies the string "Hello, world!" let def_id = tcx.hir().local_def_id(item.hir_id); // def_id identifies the main function - let ty = tcx.typeck_tables_of(def_id).node_type(hir_id); + let ty = tcx.typeck(def_id).node_type(hir_id); println!("{:?}: {:?}", expr, ty); // prints expr(HirId { owner: DefIndex(3), local_id: 4 }: "Hello, world!"): &'static str } }