From a05591ab58c1bcacc7962ca7beff29c9eff05fc4 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 4 Apr 2020 09:37:39 +0200 Subject: [PATCH] add pre-requisite for calling into compiler API (#663) --- src/rustc-driver-interacting-with-the-ast.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rustc-driver-interacting-with-the-ast.md b/src/rustc-driver-interacting-with-the-ast.md index 51d5cb6d..1749c9db 100644 --- a/src/rustc-driver-interacting-with-the-ast.md +++ b/src/rustc-driver-interacting-with-the-ast.md @@ -4,6 +4,10 @@ ## Getting the type of an expression +NOTE: For the example to compile, you will need to first run the following: + + rustup component add rustc-dev + To get the type of an expression, use the `global_ctxt` to get a `TyCtxt`: ```rust