Skip to content

Commit a89ae7c

Browse files
committed
---
yaml --- r: 171869 b: refs/heads/beta c: d4da758 h: refs/heads/master i: 171867: a85cf5c v: v3
1 parent f12f110 commit a89ae7c

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b5571ed71a5879c0495a982506258d5d267744ed
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 9554794d22840b5077aa4605fa49a587d3e018b6
34+
refs/heads/beta: d4da75892219ee8fed5fc8801a37ffe82520083d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/beta/src/librustc/session/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ pub struct Options {
105105
pub prints: Vec<PrintRequest>,
106106
pub cg: CodegenOptions,
107107
pub color: ColorConfig,
108+
pub show_span: Option<String>,
108109
pub externs: HashMap<String, Vec<String>>,
109110
pub crate_name: Option<String>,
110111
/// An optional name to use as the crate for std during std injection,
@@ -211,6 +212,7 @@ pub fn basic_options() -> Options {
211212
prints: Vec::new(),
212213
cg: basic_codegen_options(),
213214
color: Auto,
215+
show_span: None,
214216
externs: HashMap::new(),
215217
crate_name: None,
216218
alt_std_name: None,
@@ -259,7 +261,6 @@ debugging_opts! {
259261
BORROWCK_STATS,
260262
NO_LANDING_PADS,
261263
DEBUG_LLVM,
262-
SHOW_SPAN,
263264
COUNT_TYPE_SIZES,
264265
META_STATS,
265266
GC,
@@ -298,7 +299,6 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
298299
("no-landing-pads", "omit landing pads for unwinding",
299300
NO_LANDING_PADS),
300301
("debug-llvm", "enable debug output from LLVM", DEBUG_LLVM),
301-
("show-span", "show spans for compiler debugging", SHOW_SPAN),
302302
("count-type-sizes", "count the sizes of aggregate types",
303303
COUNT_TYPE_SIZES),
304304
("meta-stats", "gather metadata statistics", META_STATS),
@@ -820,6 +820,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
820820
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node), or
821821
`everybody_loops` (all function bodies replaced with `loop {}`).",
822822
"TYPE"),
823+
opt::opt_u("", "show-span", "Show spans for compiler debugging", "expr|pat|ty"),
823824
opt::flagopt("", "dep-info",
824825
"Output dependency info to <filename> after compiling, \
825826
in a format suitable for use by Makefiles", "FILENAME"),
@@ -1122,6 +1123,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11221123
prints: prints,
11231124
cg: cg,
11241125
color: color,
1126+
show_span: None,
11251127
externs: externs,
11261128
crate_name: crate_name,
11271129
alt_std_name: None,

branches/beta/src/librustc/session/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ impl Session {
199199
pub fn no_landing_pads(&self) -> bool {
200200
self.debugging_opt(config::NO_LANDING_PADS)
201201
}
202-
pub fn show_span(&self) -> bool {
203-
self.debugging_opt(config::SHOW_SPAN)
204-
}
205202
pub fn unstable_options(&self) -> bool {
206203
self.debugging_opt(config::UNSTABLE_OPTIONS)
207204
}

branches/beta/src/librustc_driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
138138
krate.encode(&mut json).unwrap();
139139
}
140140

141-
if sess.show_span() {
141+
if sess.opts.show_span.is_some() {
142142
syntax::show_span::run(sess.diagnostic(), &krate);
143143
}
144144

@@ -542,7 +542,7 @@ pub fn stop_after_phase_1(sess: &Session) -> bool {
542542
debug!("invoked with --parse-only, returning early from compile_input");
543543
return true;
544544
}
545-
if sess.show_span() {
545+
if sess.opts.show_span.is_some() {
546546
return true;
547547
}
548548
return sess.opts.debugging_opts & config::AST_JSON_NOEXPAND != 0;

branches/beta/src/librustc_driver/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn run_compiler(args: &[String]) {
132132
_ => early_error("multiple input filenames provided")
133133
};
134134

135-
let sess = build_session(sopts, input_file_path, descriptions);
135+
let mut sess = build_session(sopts, input_file_path, descriptions);
136136
let cfg = config::build_configuration(&sess);
137137
if print_crate_info(&sess, Some(&input), &odir, &ofile) {
138138
return
@@ -160,6 +160,10 @@ fn run_compiler(args: &[String]) {
160160
None => {/* continue */ }
161161
}
162162

163+
if sess.unstable_options() {
164+
sess.opts.show_span = matches.opt_str("show-span");
165+
}
166+
163167
let r = matches.opt_strs("Z");
164168
if r.contains(&("ls".to_string())) {
165169
match input {

0 commit comments

Comments
 (0)