Skip to content

Commit dc1e512

Browse files
committed
---
yaml --- r: 185864 b: refs/heads/auto c: 31e09f7 h: refs/heads/master v: v3
1 parent b377259 commit dc1e512

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: cf73e36ab01f48c883808cf58af5baed8d697538
13+
refs/heads/auto: 31e09f740a376a6ffd1b137e665a69f9b9436e1f
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ pub struct Options {
9999
pub test: bool,
100100
pub parse_only: bool,
101101
pub no_trans: bool,
102+
pub treat_err_as_bug: bool,
102103
pub no_analysis: bool,
103104
pub debugging_opts: DebuggingOptions,
104105
/// Whether to write dependency files. It's (enabled, optional filename).
@@ -223,6 +224,7 @@ pub fn basic_options() -> Options {
223224
test: false,
224225
parse_only: false,
225226
no_trans: false,
227+
treat_err_as_bug: false,
226228
no_analysis: false,
227229
debugging_opts: basic_debugging_options(),
228230
write_dependency_info: (false, None),
@@ -573,6 +575,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
573575
"Parse only; do not compile, assemble, or link"),
574576
no_trans: bool = (false, parse_bool,
575577
"Run all passes except translation; no output"),
578+
treat_err_as_bug: bool = (false, parse_bool,
579+
"Treat all errors that occur as bugs"),
576580
no_analysis: bool = (false, parse_bool,
577581
"Parse and expand the source, but run no analysis"),
578582
extra_plugins: Vec<String> = (Vec::new(), parse_list,
@@ -843,6 +847,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
843847

844848
let parse_only = debugging_opts.parse_only;
845849
let no_trans = debugging_opts.no_trans;
850+
let treat_err_as_bug = debugging_opts.treat_err_as_bug;
846851
let no_analysis = debugging_opts.no_analysis;
847852

848853
if debugging_opts.debug_llvm {
@@ -1030,6 +1035,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
10301035
test: test,
10311036
parse_only: parse_only,
10321037
no_trans: no_trans,
1038+
treat_err_as_bug: treat_err_as_bug,
10331039
no_analysis: no_analysis,
10341040
debugging_opts: debugging_opts,
10351041
write_dependency_info: write_dependency_info,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,27 @@ impl Session {
7474
self.diagnostic().handler().fatal(msg)
7575
}
7676
pub fn span_err(&self, sp: Span, msg: &str) {
77+
if self.opts.treat_err_as_bug {
78+
self.span_bug(sp, msg);
79+
}
7780
match split_msg_into_multilines(msg) {
7881
Some(msg) => self.diagnostic().span_err(sp, &msg[..]),
7982
None => self.diagnostic().span_err(sp, msg)
8083
}
8184
}
8285
pub fn span_err_with_code(&self, sp: Span, msg: &str, code: &str) {
86+
if self.opts.treat_err_as_bug {
87+
self.span_bug(sp, msg);
88+
}
8389
match split_msg_into_multilines(msg) {
8490
Some(msg) => self.diagnostic().span_err_with_code(sp, &msg[..], code),
8591
None => self.diagnostic().span_err_with_code(sp, msg, code)
8692
}
8793
}
8894
pub fn err(&self, msg: &str) {
95+
if self.opts.treat_err_as_bug {
96+
self.bug(msg);
97+
}
8998
self.diagnostic().handler().err(msg)
9099
}
91100
pub fn err_count(&self) -> uint {

0 commit comments

Comments
 (0)