diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-04-24 16:27:07 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-05-05 15:51:48 -0700 |
| commit | 56411443f2421e6726413c212a697a45d45ddfa1 (patch) | |
| tree | a640e20d31181af77f9f7f3a5ba6fa70475ce84b /src/librustc_errors | |
| parent | 96e2c34286099eea4f51daaadbb82a8fbe99e0f6 (diff) | |
| download | rust-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.rs | 6 |
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)); } |
