about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-31 21:25:16 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-01-08 04:25:33 +0100
commit2c3e5d3de023c0bfbf4a4c4d3b0d7a9844e96ffe (patch)
treed8a6e6281016eab3b52f1e0bbd0b89b7ea09035e /src/libsyntax/diagnostics
parent7e393b5b3b543d355ae16c1940cf98b6c7fcb8aa (diff)
downloadrust-2c3e5d3de023c0bfbf4a4c4d3b0d7a9844e96ffe.tar.gz
rust-2c3e5d3de023c0bfbf4a4c4d3b0d7a9844e96ffe.zip
- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
Diffstat (limited to 'src/libsyntax/diagnostics')
-rw-r--r--src/libsyntax/diagnostics/macros.rs169
1 files changed, 0 insertions, 169 deletions
diff --git a/src/libsyntax/diagnostics/macros.rs b/src/libsyntax/diagnostics/macros.rs
deleted file mode 100644
index 4ed17418c30..00000000000
--- a/src/libsyntax/diagnostics/macros.rs
+++ /dev/null
@@ -1,169 +0,0 @@
-#[macro_export]
-macro_rules! diagnostic_used {
-    ($code:ident) => {
-        let _ = $code;
-    };
-}
-
-#[macro_export]
-macro_rules! span_fatal {
-    ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.span_fatal_with_code(
-            $span,
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! span_err {
-    ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.span_err_with_code(
-            $span,
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! span_warn {
-    ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.span_warn_with_code(
-            $span,
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! struct_err {
-    ($session:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.struct_err_with_code(
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! span_err_or_warn {
-    ($is_warning:expr, $session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        if $is_warning {
-            $session.span_warn_with_code(
-                $span,
-                &format!($($message)*),
-                $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-            )
-        } else {
-            $session.span_err_with_code(
-                $span,
-                &format!($($message)*),
-                $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-            )
-        }
-    })
-}
-
-#[macro_export]
-macro_rules! struct_span_fatal {
-    ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.struct_span_fatal_with_code(
-            $span,
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! struct_span_err {
-    ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.struct_span_err_with_code(
-            $span,
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! stringify_error_code {
-    ($code:ident) => {{
-        $crate::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() {
-            $session.diagnostic().struct_dummy()
-        } else {
-            struct_span_err!($session, $span, $code, $($message)*)
-        }
-    })
-}
-
-#[macro_export]
-macro_rules! struct_span_warn {
-    ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        $session.struct_span_warn_with_code(
-            $span,
-            &format!($($message)*),
-            $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-        )
-    })
-}
-
-#[macro_export]
-macro_rules! struct_span_err_or_warn {
-    ($is_warning:expr, $session:expr, $span:expr, $code:ident, $($message:tt)*) => ({
-        $crate::diagnostic_used!($code);
-        if $is_warning {
-            $session.struct_span_warn_with_code(
-                $span,
-                &format!($($message)*),
-                $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-            )
-        } else {
-            $session.struct_span_err_with_code(
-                $span,
-                &format!($($message)*),
-                $crate::errors::DiagnosticId::Error(stringify!($code).to_owned()),
-            )
-        }
-    })
-}
-
-#[macro_export]
-macro_rules! span_note {
-    ($err:expr, $span:expr, $($message:tt)*) => ({
-        ($err).span_note($span, &format!($($message)*));
-    })
-}
-
-#[macro_export]
-macro_rules! span_help {
-    ($err:expr, $span:expr, $($message:tt)*) => ({
-        ($err).span_help($span, &format!($($message)*));
-    })
-}
-
-#[macro_export]
-macro_rules! help {
-    ($err:expr, $($message:tt)*) => ({
-        ($err).help(&format!($($message)*));
-    })
-}