howto run the examples (#1593)
This commit is contained in:
parent
1827e0c1b3
commit
c816f20abe
|
|
@ -0,0 +1,11 @@
|
||||||
|
For each example to compile, you will need to first run the following:
|
||||||
|
|
||||||
|
rustup component add rustc-dev llvm-tools
|
||||||
|
|
||||||
|
To create an executable:
|
||||||
|
|
||||||
|
rustc rustc-driver-example.rs
|
||||||
|
|
||||||
|
To run an executable:
|
||||||
|
|
||||||
|
rustup run nightly ./rustc-driver-example
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
// NOTE: For the example to compile, you will need to first run the following:
|
extern crate rustc_driver;
|
||||||
// rustup component add rustc-dev llvm-tools-preview
|
|
||||||
|
|
||||||
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
|
|
||||||
|
|
||||||
extern crate rustc_error_codes;
|
extern crate rustc_error_codes;
|
||||||
extern crate rustc_errors;
|
extern crate rustc_errors;
|
||||||
extern crate rustc_hash;
|
extern crate rustc_hash;
|
||||||
|
|
@ -12,7 +8,6 @@ extern crate rustc_hir;
|
||||||
extern crate rustc_interface;
|
extern crate rustc_interface;
|
||||||
extern crate rustc_session;
|
extern crate rustc_session;
|
||||||
extern crate rustc_span;
|
extern crate rustc_span;
|
||||||
extern crate rustc_driver;
|
|
||||||
|
|
||||||
use std::{path, process, str};
|
use std::{path, process, str};
|
||||||
|
|
||||||
|
|
@ -47,9 +42,9 @@ fn main() {
|
||||||
"#
|
"#
|
||||||
.into(),
|
.into(),
|
||||||
},
|
},
|
||||||
output_dir: None, // Option<PathBuf>
|
output_dir: None, // Option<PathBuf>
|
||||||
output_file: None, // Option<PathBuf>
|
output_file: None, // Option<PathBuf>
|
||||||
file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
|
file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
|
||||||
lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
|
lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
|
||||||
// This is a callback from the driver that is called when [`ParseSess`] is created.
|
// 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>>
|
parse_sess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
// NOTE: For the example to compile, you will need to first run the following:
|
extern crate rustc_driver;
|
||||||
// rustup component add rustc-dev llvm-tools-preview
|
|
||||||
|
|
||||||
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
|
|
||||||
|
|
||||||
extern crate rustc_error_codes;
|
extern crate rustc_error_codes;
|
||||||
extern crate rustc_errors;
|
extern crate rustc_errors;
|
||||||
extern crate rustc_hash;
|
extern crate rustc_hash;
|
||||||
|
|
@ -12,7 +8,6 @@ extern crate rustc_hir;
|
||||||
extern crate rustc_interface;
|
extern crate rustc_interface;
|
||||||
extern crate rustc_session;
|
extern crate rustc_session;
|
||||||
extern crate rustc_span;
|
extern crate rustc_span;
|
||||||
extern crate rustc_driver;
|
|
||||||
|
|
||||||
use rustc_errors::registry;
|
use rustc_errors::registry;
|
||||||
use rustc_session::config::{self, CheckCfg};
|
use rustc_session::config::{self, CheckCfg};
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
#![feature(rustc_private)]
|
#![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_ast_pretty;
|
extern crate rustc_ast_pretty;
|
||||||
|
extern crate rustc_driver;
|
||||||
extern crate rustc_error_codes;
|
extern crate rustc_error_codes;
|
||||||
extern crate rustc_errors;
|
extern crate rustc_errors;
|
||||||
extern crate rustc_hash;
|
extern crate rustc_hash;
|
||||||
|
|
@ -13,7 +9,6 @@ extern crate rustc_hir;
|
||||||
extern crate rustc_interface;
|
extern crate rustc_interface;
|
||||||
extern crate rustc_session;
|
extern crate rustc_session;
|
||||||
extern crate rustc_span;
|
extern crate rustc_span;
|
||||||
extern crate rustc_driver;
|
|
||||||
|
|
||||||
use std::{path, process, str};
|
use std::{path, process, str};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue