about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/plugin.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-01-16 15:54:58 -0800
committerBrian Anderson <banderson@mozilla.com>2015-01-20 11:27:14 -0800
commit953d6dfd7e1b1d5c5b17314b6e3bdec15d8e7a01 (patch)
tree9484471680b6a961392df1120297ed868795f77b /src/libsyntax/diagnostics/plugin.rs
parenta0f86de49748b472d4d189d9688b0d856c000914 (diff)
downloadrust-953d6dfd7e1b1d5c5b17314b6e3bdec15d8e7a01.tar.gz
rust-953d6dfd7e1b1d5c5b17314b6e3bdec15d8e7a01.zip
Make error code registration work again. #19624
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index 1469c50061c..0e99829fa1c 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -65,6 +65,13 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
         }
         ()
     });
+    with_registered_diagnostics(|diagnostics| {
+        if !diagnostics.contains_key(&code.name) {
+            ecx.span_err(span, &format!(
+                "used diagnostic code {} not registered", token::get_ident(code).get()
+            )[]);
+        }
+    });
     MacExpr::new(quote_expr!(ecx, ()))
 }