From d1fcf611175e695c35c6cc0537d710277c1a5c6f Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 13 Oct 2022 10:13:02 +0100 Subject: errors: generate typed identifiers in each crate Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood --- compiler/rustc_plugin_impl/locales/en-US.ftl | 4 ++++ compiler/rustc_plugin_impl/src/lib.rs | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 compiler/rustc_plugin_impl/locales/en-US.ftl (limited to 'compiler/rustc_plugin_impl') diff --git a/compiler/rustc_plugin_impl/locales/en-US.ftl b/compiler/rustc_plugin_impl/locales/en-US.ftl new file mode 100644 index 00000000000..8db32a42c1d --- /dev/null +++ b/compiler/rustc_plugin_impl/locales/en-US.ftl @@ -0,0 +1,4 @@ +plugin_impl_load_plugin_error = {$msg} + +plugin_impl_malformed_plugin_attribute = malformed `plugin` attribute + .label = malformed attribute diff --git a/compiler/rustc_plugin_impl/src/lib.rs b/compiler/rustc_plugin_impl/src/lib.rs index 9ac27c65da8..3f03eef9ee3 100644 --- a/compiler/rustc_plugin_impl/src/lib.rs +++ b/compiler/rustc_plugin_impl/src/lib.rs @@ -11,11 +11,15 @@ #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] +use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; use rustc_lint::LintStore; +use rustc_macros::fluent_messages; mod errors; pub mod load; +fluent_messages! { "../locales/en-US.ftl" } + /// Structure used to register plugins. /// /// A plugin registrar function takes an `&mut Registry` and should call -- cgit 1.4.1-3-g733a5