Extend the "treat-err-as-bug" option to cover calls to fatal.
This commit is contained in:
parent
4dfa81f6fa
commit
ab8a769c57
1 changed files with 9 additions and 0 deletions
|
|
@ -64,12 +64,21 @@ pub struct Session {
|
|||
|
||||
impl Session {
|
||||
pub fn span_fatal(&self, sp: Span, msg: &str) -> ! {
|
||||
if self.opts.treat_err_as_bug {
|
||||
self.span_bug(sp, msg);
|
||||
}
|
||||
self.diagnostic().span_fatal(sp, msg)
|
||||
}
|
||||
pub fn span_fatal_with_code(&self, sp: Span, msg: &str, code: &str) -> ! {
|
||||
if self.opts.treat_err_as_bug {
|
||||
self.span_bug(sp, msg);
|
||||
}
|
||||
self.diagnostic().span_fatal_with_code(sp, msg, code)
|
||||
}
|
||||
pub fn fatal(&self, msg: &str) -> ! {
|
||||
if self.opts.treat_err_as_bug {
|
||||
self.bug(msg);
|
||||
}
|
||||
self.diagnostic().handler().fatal(msg)
|
||||
}
|
||||
pub fn span_err(&self, sp: Span, msg: &str) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue