about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
diff options
context:
space:
mode:
authorTshepang Mbambo <tshepang@gmail.com>2023-02-15 16:40:25 +0200
committerGitHub <noreply@github.com>2023-02-15 11:40:25 -0300
commit648cf5f8ac524185cfa9fecf4e699b01d363dbe9 (patch)
treeaef2cf49bf2007e48fe0f43184804159d587cc4f /src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
parent240f076d804d8682994c49a92b5407ebbbe1fe3a (diff)
downloadrust-648cf5f8ac524185cfa9fecf4e699b01d363dbe9.tar.gz
rust-648cf5f8ac524185cfa9fecf4e699b01d363dbe9.zip
howto run the examples (#1593)
Diffstat (limited to 'src/doc/rustc-dev-guide/examples/rustc-driver-example.rs')
-rw-r--r--src/doc/rustc-dev-guide/examples/rustc-driver-example.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
index 13a3ebcc99e..9708ab01d69 100644
--- a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
+++ b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
@@ -1,10 +1,6 @@
 #![feature(rustc_private)]
 
-// NOTE: For the example to compile, you will need to first run the following:
-//   rustup component add rustc-dev llvm-tools-preview
-
-// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
-
+extern crate rustc_driver;
 extern crate rustc_error_codes;
 extern crate rustc_errors;
 extern crate rustc_hash;
@@ -12,7 +8,6 @@ extern crate rustc_hir;
 extern crate rustc_interface;
 extern crate rustc_session;
 extern crate rustc_span;
-extern crate rustc_driver;
 
 use std::{path, process, str};
 
@@ -47,9 +42,9 @@ fn main() {
 "#
             .into(),
         },
-        output_dir: None,  // Option<PathBuf>
-        output_file: None, // Option<PathBuf>
-        file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
+        output_dir: None,                // Option<PathBuf>
+        output_file: None,               // Option<PathBuf>
+        file_loader: None,               // Option<Box<dyn FileLoader + Send + Sync>>
         lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
         // This is a callback from the driver that is called when [`ParseSess`] is created.
         parse_sess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>>