From 56411443f2421e6726413c212a697a45d45ddfa1 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Mon, 24 Apr 2017 16:27:07 -0700 Subject: Use diagnostics for trace_macro instead of println --- src/librustc_errors/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/librustc_errors') 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>(&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>(&self, sp: S, msg: &str) -> ! { self.span_bug(sp, &format!("unimplemented {}", msg)); } -- cgit 1.4.1-3-g733a5