1
Fork 0

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:
David Wood 2022-10-13 10:13:02 +01:00
parent f9216b7564
commit d1fcf61117
151 changed files with 1721 additions and 1440 deletions

View file

@ -61,9 +61,7 @@ pub fn newtype_index(input: TokenStream) -> TokenStream {
/// For example, given the following invocation of the macro..
///
/// ```ignore (rust)
/// fluent_messages! {
/// typeck => "./typeck.ftl",
/// }
/// fluent_messages! { "./typeck.ftl" }
/// ```
/// ..where `typeck.ftl` has the following contents..
///
@ -77,9 +75,7 @@ pub fn newtype_index(input: TokenStream) -> TokenStream {
/// will generate the following code:
///
/// ```ignore (rust)
/// pub static DEFAULT_LOCALE_RESOURCES: &'static [&'static str] = &[
/// include_str!("./typeck.ftl"),
/// ];
/// pub static DEFAULT_LOCALE_RESOURCE: &'static [&'static str] = include_str!("./typeck.ftl");
///
/// mod fluent_generated {
/// mod typeck {