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 <david.wood@huawei.com>
This commit is contained in:
parent
f9216b7564
commit
d1fcf61117
151 changed files with 1721 additions and 1440 deletions
|
@ -21,8 +21,10 @@ extern crate tracing;
|
|||
|
||||
use crate::deriving::*;
|
||||
|
||||
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
||||
use rustc_expand::base::{MacroExpanderFn, ResolverExpand, SyntaxExtensionKind};
|
||||
use rustc_expand::proc_macro::BangProcMacro;
|
||||
use rustc_macros::fluent_messages;
|
||||
use rustc_span::symbol::sym;
|
||||
|
||||
mod alloc_error_handler;
|
||||
|
@ -54,6 +56,8 @@ pub mod proc_macro_harness;
|
|||
pub mod standard_library_imports;
|
||||
pub mod test_harness;
|
||||
|
||||
fluent_messages! { "../locales/en-US.ftl" }
|
||||
|
||||
pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
|
||||
let mut register = |name, kind| resolver.register_builtin_macro(name, kind);
|
||||
macro register_bang($($name:ident: $f:expr,)*) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue