about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/plugin.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-12-30 12:27:10 +0000
committerbors <bors@rust-lang.org>2015-12-30 12:27:10 +0000
commit176ee349a704a1aee9dfb79c27c5da20db7942a5 (patch)
tree99e1ead256ccd196b4135455ef037b14ab3094fa /src/libsyntax/diagnostics/plugin.rs
parenta06bb977d86dcfe786d4265f4807a11c39b51141 (diff)
parent04d972906d05e6c27452e1ae35970c30e7cf6e6b (diff)
downloadrust-176ee349a704a1aee9dfb79c27c5da20db7942a5.tar.gz
rust-176ee349a704a1aee9dfb79c27c5da20db7942a5.zip
Auto merge of #30542 - nrc:errs-base, r=nagisa
As discussed [here](https://internals.rust-lang.org/t/more-structured-errors/3005)

r? @nikomatsakis or anyone else on the @rust-lang/compiler team
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index be0d5729c70..d17ca3892dc 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -62,10 +62,10 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
         match diagnostics.get_mut(&code.name) {
             // Previously used errors.
             Some(&mut ErrorInfo { description: _, use_site: Some(previous_span) }) => {
-                ecx.span_warn(span, &format!(
+                ecx.struct_span_warn(span, &format!(
                     "diagnostic code {} already used", code
-                ));
-                ecx.span_note(previous_span, "previous invocation");
+                )).span_note(previous_span, "previous invocation")
+                  .emit();
             }
             // Newly used errors.
             Some(ref mut info) => {