Skip to content

Commit ab8a769

Browse files
committed
Extend the "treat-err-as-bug" option to cover calls to fatal.
1 parent 4dfa81f commit ab8a769

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc/session/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,21 @@ pub struct Session {
6464

6565
impl Session {
6666
pub fn span_fatal(&self, sp: Span, msg: &str) -> ! {
67+
if self.opts.treat_err_as_bug {
68+
self.span_bug(sp, msg);
69+
}
6770
self.diagnostic().span_fatal(sp, msg)
6871
}
6972
pub fn span_fatal_with_code(&self, sp: Span, msg: &str, code: &str) -> ! {
73+
if self.opts.treat_err_as_bug {
74+
self.span_bug(sp, msg);
75+
}
7076
self.diagnostic().span_fatal_with_code(sp, msg, code)
7177
}
7278
pub fn fatal(&self, msg: &str) -> ! {
79+
if self.opts.treat_err_as_bug {
80+
self.bug(msg);
81+
}
7382
self.diagnostic().handler().fatal(msg)
7483
}
7584
pub fn span_err(&self, sp: Span, msg: &str) {

0 commit comments

Comments
 (0)