about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/macros.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-01-13 14:05:51 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-01-15 10:28:00 +0100
commitc8a110ed6329022850fd9d473ec987ba1459a64f (patch)
treef69bf26185b852a219a462bf4b8c6c4f3ff520b0 /src/libsyntax/diagnostics/macros.rs
parent3f92e8d89861f0f5408ad9381a7467ec6e7d76bc (diff)
downloadrust-c8a110ed6329022850fd9d473ec987ba1459a64f.tar.gz
rust-c8a110ed6329022850fd9d473ec987ba1459a64f.zip
Add error code for unstable feature errors
Diffstat (limited to 'src/libsyntax/diagnostics/macros.rs')
-rw-r--r--src/libsyntax/diagnostics/macros.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/diagnostics/macros.rs b/src/libsyntax/diagnostics/macros.rs
index c01836b6194..61f3e7046f1 100644
--- a/src/libsyntax/diagnostics/macros.rs
+++ b/src/libsyntax/diagnostics/macros.rs
@@ -106,6 +106,14 @@ macro_rules! struct_span_err {
 }
 
 #[macro_export]
+macro_rules! stringify_error_code {
+    ($code:ident) => ({
+        __diagnostic_used!($code);
+        $crate::errors::DiagnosticId::Error(stringify!($code).to_owned())
+    })
+}
+
+#[macro_export]
 macro_rules! type_error_struct {
     ($session:expr, $span:expr, $typ:expr, $code:ident, $($message:tt)*) => ({
         if $typ.references_error() {