Skip to content

Commit 5fb15d0

Browse files
committed
Replace --show-span with -Z show-span
1 parent d70ab2b commit 5fb15d0

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/librustc/session/config.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ pub struct Options {
132132
pub prints: Vec<PrintRequest>,
133133
pub cg: CodegenOptions,
134134
pub color: ColorConfig,
135-
pub show_span: Option<String>,
136135
pub externs: HashMap<String, Vec<String>>,
137136
pub crate_name: Option<String>,
138137
/// An optional name to use as the crate for std during std injection,
@@ -243,7 +242,6 @@ pub fn basic_options() -> Options {
243242
prints: Vec::new(),
244243
cg: basic_codegen_options(),
245244
color: ColorConfig::Auto,
246-
show_span: None,
247245
externs: HashMap::new(),
248246
crate_name: None,
249247
alt_std_name: None,
@@ -634,6 +632,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
634632
"don't clear the resolution tables after analysis"),
635633
keep_ast: bool = (false, parse_bool,
636634
"keep the AST after lowering it to HIR"),
635+
show_span: Option<String> = (None, parse_opt_string,
636+
"show spans for compiler debugging (expr|pat|ty)"),
637637
}
638638

639639
pub fn default_lib_output() -> CrateType {
@@ -882,7 +882,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
882882
`hir` (the HIR), `hir,identified`, or
883883
`hir,typed` (HIR with types for each node).",
884884
"TYPE"),
885-
opt::opt_u("", "show-span", "Show spans for compiler debugging", "expr|pat|ty"),
886885
]);
887886
opts
888887
}
@@ -1123,7 +1122,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11231122
prints: prints,
11241123
cg: cg,
11251124
color: color,
1126-
show_span: None,
11271125
externs: externs,
11281126
crate_name: crate_name,
11291127
alt_std_name: None,

src/librustc_driver/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
428428
println!("Pre-expansion node count: {}", count_nodes(&krate));
429429
}
430430

431-
if let Some(ref s) = sess.opts.show_span {
431+
if let Some(ref s) = sess.opts.debugging_opts.show_span {
432432
syntax::show_span::run(sess.diagnostic(), s, &krate);
433433
}
434434

src/librustc_driver/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,9 @@ pub fn run_compiler<'a>(args: &[String], callbacks: &mut CompilerCalls<'a>) {
138138
};
139139

140140
let cstore = Rc::new(CStore::new(token::get_ident_interner()));
141-
let mut sess = build_session(sopts, input_file_path, descriptions,
141+
let sess = build_session(sopts, input_file_path, descriptions,
142142
cstore.clone());
143143
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
144-
if sess.unstable_options() {
145-
sess.opts.show_span = matches.opt_str("show-span");
146-
}
147144
let mut cfg = config::build_configuration(&sess);
148145
target_features::add_configuration(&mut cfg, &sess);
149146

@@ -387,7 +384,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
387384
fn build_controller(&mut self, sess: &Session) -> CompileController<'a> {
388385
let mut control = CompileController::basic();
389386

390-
if sess.opts.parse_only || sess.opts.show_span.is_some() ||
387+
if sess.opts.parse_only || sess.opts.debugging_opts.show_span.is_some() ||
391388
sess.opts.debugging_opts.ast_json_noexpand {
392389
control.after_parse.stop = Compilation::Stop;
393390
}

0 commit comments

Comments
 (0)