about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-30 16:41:08 -0700
committerbors <bors@rust-lang.org>2016-03-30 16:41:08 -0700
commit30a3849f228833f9dc280120126d16aef3a292ba (patch)
tree78d53ddcbba1bf4214951a5c9052da7e949838c1 /src/libsyntax/errors
parentbfacabc6a2b59771aa336ff420c363d9695a6ad2 (diff)
parent458fae709cc89d1add09303f2ae2dcac6d526e32 (diff)
downloadrust-30a3849f228833f9dc280120126d16aef3a292ba.tar.gz
rust-30a3849f228833f9dc280120126d16aef3a292ba.zip
Auto merge of #32628 - Manishearth:rollup, r=Manishearth
Rollup of 4 pull requests

- Successful merges: #32259, #32494, #32612, #32618
- Failed merges: #32562
Diffstat (limited to 'src/libsyntax/errors')
-rw-r--r--src/libsyntax/errors/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/errors/mod.rs b/src/libsyntax/errors/mod.rs
index 9e1cb60f54f..c8c12d5a883 100644
--- a/src/libsyntax/errors/mod.rs
+++ b/src/libsyntax/errors/mod.rs
@@ -370,6 +370,7 @@ pub struct Handler {
     emit: RefCell<Box<Emitter>>,
     pub can_emit_warnings: bool,
     treat_err_as_bug: bool,
+    continue_after_error: Cell<bool>,
     delayed_span_bug: RefCell<Option<(MultiSpan, String)>>,
 }
 
@@ -392,10 +393,15 @@ impl Handler {
             emit: RefCell::new(e),
             can_emit_warnings: can_emit_warnings,
             treat_err_as_bug: treat_err_as_bug,
+            continue_after_error: Cell::new(true),
             delayed_span_bug: RefCell::new(None),
         }
     }
 
+    pub fn set_continue_after_error(&self, continue_after_error: bool) {
+        self.continue_after_error.set(continue_after_error);
+    }
+
     pub fn struct_dummy<'a>(&'a self) -> DiagnosticBuilder<'a> {
         DiagnosticBuilder::new(&self.emit, Level::Cancelled, "")
     }
@@ -612,6 +618,7 @@ impl Handler {
                 lvl: Level) {
         if lvl == Warning && !self.can_emit_warnings { return }
         self.emit.borrow_mut().emit(msp, msg, None, lvl);
+        if !self.continue_after_error.get() { self.abort_if_errors(); }
     }
     pub fn emit_with_code(&self,
                           msp: Option<&MultiSpan>,
@@ -620,10 +627,12 @@ impl Handler {
                           lvl: Level) {
         if lvl == Warning && !self.can_emit_warnings { return }
         self.emit.borrow_mut().emit(msp, msg, Some(code), lvl);
+        if !self.continue_after_error.get() { self.abort_if_errors(); }
     }
     pub fn custom_emit(&self, rsp: RenderSpan, msg: &str, lvl: Level) {
         if lvl == Warning && !self.can_emit_warnings { return }
         self.emit.borrow_mut().custom_emit(&rsp, msg, lvl);
+        if !self.continue_after_error.get() { self.abort_if_errors(); }
     }
 }