From 199931ce910776e6cd035da8cdf1dd81f4d411ba Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sat, 13 Jul 2019 10:02:40 +0100 Subject: [PATCH] Make `register_[long_]diagnostics` hygienic --- src/librustc_lint/error_codes.rs | 2 +- src/librustc_metadata/error_codes.rs | 2 +- src/librustc_passes/error_codes.rs | 2 +- src/librustc_plugin/error_codes.rs | 2 +- src/librustc_resolve/error_codes.rs | 2 +- src/libsyntax/diagnostics/macros.rs | 8 ++++---- src/libsyntax_ext/error_codes.rs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/librustc_lint/error_codes.rs b/src/librustc_lint/error_codes.rs index 3165673111c..d7c39b780bf 100644 --- a/src/librustc_lint/error_codes.rs +++ b/src/librustc_lint/error_codes.rs @@ -1,4 +1,4 @@ -use syntax::{register_diagnostic, register_diagnostics}; +use syntax::register_diagnostics; register_diagnostics! { E0721, // `await` keyword diff --git a/src/librustc_metadata/error_codes.rs b/src/librustc_metadata/error_codes.rs index 9ac582ebc42..7c631736591 100644 --- a/src/librustc_metadata/error_codes.rs +++ b/src/librustc_metadata/error_codes.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; +use syntax::{register_diagnostics, register_long_diagnostics}; register_long_diagnostics! { E0454: r##" diff --git a/src/librustc_passes/error_codes.rs b/src/librustc_passes/error_codes.rs index e3c6b16703a..36ebe5cf455 100644 --- a/src/librustc_passes/error_codes.rs +++ b/src/librustc_passes/error_codes.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; +use syntax::{register_diagnostics, register_long_diagnostics}; register_long_diagnostics! { /* diff --git a/src/librustc_plugin/error_codes.rs b/src/librustc_plugin/error_codes.rs index 68462bd83ef..9e76f52a111 100644 --- a/src/librustc_plugin/error_codes.rs +++ b/src/librustc_plugin/error_codes.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; +use syntax::{register_diagnostics, register_long_diagnostics}; register_long_diagnostics! { diff --git a/src/librustc_resolve/error_codes.rs b/src/librustc_resolve/error_codes.rs index 7cd26dce144..15194a5d146 100644 --- a/src/librustc_resolve/error_codes.rs +++ b/src/librustc_resolve/error_codes.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; +use syntax::{register_diagnostics, register_long_diagnostics}; // Error messages for EXXXX errors. Each message should start and end with a // new line, and be wrapped to 80 characters. In vim you can `:set tw=80` and diff --git a/src/libsyntax/diagnostics/macros.rs b/src/libsyntax/diagnostics/macros.rs index 6f7493ad597..b754d083376 100644 --- a/src/libsyntax/diagnostics/macros.rs +++ b/src/libsyntax/diagnostics/macros.rs @@ -170,19 +170,19 @@ macro_rules! help { #[macro_export] macro_rules! register_diagnostics { ($($code:tt),*) => ( - $(register_diagnostic! { $code })* + $($crate::register_diagnostic! { $code })* ); ($($code:tt),*,) => ( - $(register_diagnostic! { $code })* + $($crate::register_diagnostic! { $code })* ) } #[macro_export] macro_rules! register_long_diagnostics { ($($code:tt: $description:tt),*) => ( - $(register_diagnostic! { $code, $description })* + $($crate::register_diagnostic! { $code, $description })* ); ($($code:tt: $description:tt),*,) => ( - $(register_diagnostic! { $code, $description })* + $($crate::register_diagnostic! { $code, $description })* ) } diff --git a/src/libsyntax_ext/error_codes.rs b/src/libsyntax_ext/error_codes.rs index 9bbd9fdec17..9ec551b4395 100644 --- a/src/libsyntax_ext/error_codes.rs +++ b/src/libsyntax_ext/error_codes.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use syntax::{register_diagnostic, register_long_diagnostics}; +use syntax::register_long_diagnostics; // Error messages for EXXXX errors. // Each message should start and end with a new line, and be wrapped to 80 characters.