about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-04-24 16:27:07 -0700
committerEsteban Küber <esteban@kuber.com.ar>2017-05-05 15:51:48 -0700
commit56411443f2421e6726413c212a697a45d45ddfa1 (patch)
treea640e20d31181af77f9f7f3a5ba6fa70475ce84b /src/librustc_errors
parent96e2c34286099eea4f51daaadbb82a8fbe99e0f6 (diff)
downloadrust-56411443f2421e6726413c212a697a45d45ddfa1.tar.gz
rust-56411443f2421e6726413c212a697a45d45ddfa1.zip
Use diagnostics for trace_macro instead of println
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 02d8297dd46..06aafa05052 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -388,6 +388,12 @@ impl Handler {
     pub fn span_note_without_error<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
         self.emit(&sp.into(), msg, Note);
     }
+    pub fn span_label_without_error(&self, sp: Span, msg: &str, lbl: &str) {
+        let mut db = DiagnosticBuilder::new(self, Note, msg);
+        db.set_span(sp);
+        db.span_label(sp, &lbl);
+        db.emit();
+    }
     pub fn span_unimpl<S: Into<MultiSpan>>(&self, sp: S, msg: &str) -> ! {
         self.span_bug(sp, &format!("unimplemented {}", msg));
     }