diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-14 04:22:19 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-14 11:04:41 +0530 |
| commit | 4ff1d20ad71c01adcaa61ea1c11f3ea14ce8c983 (patch) | |
| tree | 4b2b47afef30690155ef1e4d58626c0a0a4e9443 | |
| parent | 98c7519826a129fea55e891f0930f2c5d3d8bc10 (diff) | |
| parent | 5fb15d02379b2d18176bd5a920a94157a3344e51 (diff) | |
| download | rust-4ff1d20ad71c01adcaa61ea1c11f3ea14ce8c983.tar.gz rust-4ff1d20ad71c01adcaa61ea1c11f3ea14ce8c983.zip | |
Rollup merge of #30835 - kraai:show-span, r=sanxiyn
I think this will fix #30656.
| -rw-r--r-- | src/librustc/session/config.rs | 6 | ||||
| -rw-r--r-- | src/librustc_driver/driver.rs | 2 | ||||
| -rw-r--r-- | src/librustc_driver/lib.rs | 7 |
3 files changed, 5 insertions, 10 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 0134bcdf175..80bfbe4edda 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -132,7 +132,6 @@ pub struct Options { pub prints: Vec<PrintRequest>, pub cg: CodegenOptions, pub color: ColorConfig, - pub show_span: Option<String>, pub externs: HashMap<String, Vec<String>>, pub crate_name: Option<String>, /// An optional name to use as the crate for std during std injection, @@ -243,7 +242,6 @@ pub fn basic_options() -> Options { prints: Vec::new(), cg: basic_codegen_options(), color: ColorConfig::Auto, - show_span: None, externs: HashMap::new(), crate_name: None, alt_std_name: None, @@ -634,6 +632,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "don't clear the resolution tables after analysis"), keep_ast: bool = (false, parse_bool, "keep the AST after lowering it to HIR"), + show_span: Option<String> = (None, parse_opt_string, + "show spans for compiler debugging (expr|pat|ty)"), } pub fn default_lib_output() -> CrateType { @@ -882,7 +882,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> { `hir` (the HIR), `hir,identified`, or `hir,typed` (HIR with types for each node).", "TYPE"), - opt::opt_u("", "show-span", "Show spans for compiler debugging", "expr|pat|ty"), ]); opts } @@ -1123,7 +1122,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { prints: prints, cg: cg, color: color, - show_span: None, externs: externs, crate_name: crate_name, alt_std_name: None, diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index d172bfb4413..840260da330 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -428,7 +428,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input) println!("Pre-expansion node count: {}", count_nodes(&krate)); } - if let Some(ref s) = sess.opts.show_span { + if let Some(ref s) = sess.opts.debugging_opts.show_span { syntax::show_span::run(sess.diagnostic(), s, &krate); } diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 7b8970876f6..cdac3de3682 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -138,12 +138,9 @@ pub fn run_compiler<'a>(args: &[String], callbacks: &mut CompilerCalls<'a>) { }; let cstore = Rc::new(CStore::new(token::get_ident_interner())); - let mut sess = build_session(sopts, input_file_path, descriptions, + let sess = build_session(sopts, input_file_path, descriptions, cstore.clone()); rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess)); - if sess.unstable_options() { - sess.opts.show_span = matches.opt_str("show-span"); - } let mut cfg = config::build_configuration(&sess); target_features::add_configuration(&mut cfg, &sess); @@ -387,7 +384,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls { fn build_controller(&mut self, sess: &Session) -> CompileController<'a> { let mut control = CompileController::basic(); - if sess.opts.parse_only || sess.opts.show_span.is_some() || + if sess.opts.parse_only || sess.opts.debugging_opts.show_span.is_some() || sess.opts.debugging_opts.ast_json_noexpand { control.after_parse.stop = Compilation::Stop; } |
